Sep 25, 2009, 12:16 PM
Post #2 of 6
Re: [DoolinDalton] @ARGV[$i] vs $ARG[$i]
[In reply to]
In my program called param_test.pl, I have just one line
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
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 to fail. When accessing an element in an array called @blah, the notation is $blah, but it seems in this example, @blah also works.