> From: "Taylor Lewick" <[EMAIL PROTECTED]>
> Date: Tue, 21 May 2002 08:00:45 -0500
> To: <[EMAIL PROTECTED]>
> Subject: avoid backticking if at all possible - Re: perl awk question
> 
> Thanks drieux, I looked over the code you posted, most of it makes sense, but
> am still a little confused over a couple of things,
> Why are you setting $infile and $outfile to ARGV values?  I thought those were
> being past from the command line, but in this instance, I know what files I
> want to access. 

[localhost:~/Programming/Perl/Various code] tor% cat argv.pl
#!/usr/bin/perl -w
for (@ARGV) {
push @ARGV;
print "$_\n";
}
[localhost:~/Programming/Perl/Various code] tor% ./argv.pl 2 3 bananas
apples
2
3
bananas
apples
[localhost:~/Programming/Perl/Various code] tor%

You can use the $ARGV[X] values directly like above, or you can put them in
variables. I guess that's what drieux did. Everything passed from the
command line are put into to the @ARGV array.
So, when I write 
% ./argv.pl 2 3 bananas apples
@ARGV looks like this: qw(2 3 bananas apples)

Tor


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to