Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really Basic but a biginner

Status
Not open for further replies.

Cmca123

Technical User
Jun 14, 2007
2
GB
Hi,

I'd like to pass a varaible to my perl script and then print it, is $1 correct syntax. thanks

#!/usr/bin/perl
use strict;
use warnings;
$string = $1;
print $string;
 
its okay.. solution

my $var = $ARGV[0];
print $var1;
 
Alternatively
Code:
print $ARGV[0];

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top