We don't bite newbies here... much | |
PerlMonks |
Re: Directory Listing to an Arrayby vkonovalov (Monk) |
on Apr 29, 2002 at 06:12 UTC ( [id://162776]=note: print w/replies, xml ) | Need Help?? |
This is *dangerous* code snippet, because it corrupts value of $_ variable by while($_=readdir). (didn't you read "seven sins of perl (revisited)?") You should place local $_ somewhere at the beginning of a sub. Or write instead of "while" ..... for (readdir) which will localize $_ itself.
In Section
Cool Uses for Perl
|
|