WRT your first SSCCE: while does not automatically assign the result of its CONDITION evaluation to $_ (in contrast to the
while (<FILEHANDLE>) { do_something_with($_); }
special case):
c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "foreach my $filename (qw(a b c)) { dd 'before while loop, $filename is', $filename; while ($filename) { dd 'in while loop, $_ is', $_; last; } } " ("before while loop, \$filename is", "a") ("in while loop, \$_ is", undef) ("before while loop, \$filename is", "b") ("in while loop, \$_ is", undef) ("before while loop, \$filename is", "c") ("in while loop, \$_ is", undef)
Give a man a fish: <%-{-{-{-<
In reply to Re: Split and print hash based on regex
by AnomalousMonk
in thread Split and print hash based on regex
by Maire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |