Re: ARGV behaviour in getopts std

2010-01-24 Thread Harry Putnam
John W. Krahn jwkr...@shaw.ca writes: print Ditching $ditch\n; $ditch = ''; What is the point of assigning to $ditch if it goes out of scope at the next line? I can only ascribe it to deep seated stupidity What would be the better way to test what the for loop is doing? -- To

ARGV behaviour in getopts std

2010-01-23 Thread Harry Putnam
This is probably blindingly simple but I'm not understanding why @ARGV is not reduced to () (no args)? in this example I'm trying to understand what happens with ARGV in s getops loop with arguments after the getopts Options, or any time there is ARGV, I guess. Why doesn't the `for loop' reduce

Re: ARGV behaviour in getopts std

2010-01-23 Thread Shawn H Corey
Harry Putnam wrote: This is probably blindingly simple but I'm not understanding why @ARGV is not reduced to () (no args)? in this example To Perl, @ARGV is just another array. It has some special features but can be assigned values just like other arrays. You can use it to do tricks, like

Re: ARGV behaviour in getopts std

2010-01-23 Thread Uri Guttman
HP == Harry Putnam rea...@newsguy.com writes: HP print Now lets ditch the rest in a for loop\n; HP for (@ARGV){ change that for to a while. for will create a list of aliases to the array elements passed to it. it doesn't check its length as you seem to think. while will loop until @ARGV is

Re: ARGV behaviour in getopts std

2010-01-23 Thread John W. Krahn
Harry Putnam wrote: This is probably blindingly simple but I'm not understanding why @ARGV is not reduced to () (no args)? in this example [ SNIP ] print Now lets ditch the rest in a for loop\n; for (@ARGV){ my $ditch = shift; perldoc perlsyn [ SNIP ] Foreach Loops [ SNIP ] The