> $ARGV[$count] represents the index of the > array. I am passing in parameters and some > contain space between two words and I noticed > that using while (<@ARGV>) it loops the exact > amount of times per words, not per parameter. > So if I passed "Hi There" it goes around the > loop twice rather than once. On the second > iteration there is no value to process.
Could you clarify something for me: Is this supposed to represent a subroutine or a script? If that's the former, then you definately don't want to use @ARGV. You'd want: sub function { foreach my $arg (@_) { print "Got argument: $arg\n"; } } If it's the latter, then remember: @ARGV is a special variable holding filenames to be processed. When you do: while (<ARGV>) { } you are really iterating over these files in sequence and you can't do them out of sequence. Perl has abilities to treat files as arrays, but remember that the index is reset for every file... your script doesn't do that. Again, if you want the arguments and not the information within those files use: foreach (@ARGV) { } I hope this helps, otherwise please provide the clarification I need. Take care, Jonathan Paton __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]