
DoolinDalton
Novice
Sep 25, 2009, 12:16 PM
Post #2 of 6
(2236 views)
|
Re: [DoolinDalton] @ARGV[$i] vs $ARG[$i]
[In reply to]
|
Can't Post
|
|
In my program called param_test.pl, I have just one line print @ARGV[0]; When I run this program by typing in param_test.pl hello, it outputs the word hello. When I change the line in my program to print $ARGV[0]; I get the same result. I'm confused on why the second one works. ARGV is an array of the command line input parameters. In short it is an array, so shouldn't it only work when I use @ in front of it? Actually, I meant the other way. I expected the notation @ARV[0] to fail. When accessing an element in an array called @blah, the notation is $blah, but it seems in this example, @blah also works.
|