|The stupid question is the question not asked|
Why/how are these different?by perl-diddler (Hermit)
|on Jan 31, 2013 at 02:49 UTC||Need Help??|
perl-diddler has asked for the
wisdom of the Perl Monks concerning the following question:
I have two snippets of code and I was wondering why they produced different results (P is like printf w/auto LF).
Note, I didn't say "for my $i...". That would make sense. But the behavior seems like that's what it did. However, a similar construct the reversed "if", doesn't act this way:
This is in perl 5.16.1. Could someone explain why these look inconsistent to me? (i.e. "$_" value in the conditional statement isn't consistent with it's value in the test or outside the loop.Thanks!
FWIW -- the postfix 'while' seems to be consistent, giving the same results in regular vs. postfix form;