|XP is just a number|
Re: opening a file destroys nulling entries in a list?!?!by cfreak (Chaplain)
|on Aug 07, 2003 at 02:56 UTC||Need Help??|
$_ is a global variable. Your while is setting it to the last record of your filehandle and since your files end with a \n, $_ returns blank (I guess $_ gets set before the test is done to see if it has a value). Since this is Perl there is more than one way to get around this:
You can localize $_ in your sub like so:
Or you can set each line of the file to a variable in the while like so:
Hope that helpsLobster Aliens Are attacking the world!