in reply to Re: Parsing files in a directory using a list.
in thread Parsing files in a directory using a list.

Hi Discipulus. I noticed you used a my declaration in a conditional statement. This is something I avoid since it can cause strange and subtle bugs. Refer to this node where Haukex pointed out to me the reason with this quote from perlsyn.

NOTE: The behaviour of a my, state, or our modified with a statement modifier conditional or loop construct (for example, my $x if ...) is undefined. The value of the my variable may be undef, any previously assigned value, or possibly anything else. Don't rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons.