Problems? Is your data what you think it is? | |
PerlMonks |
RE: RE: Re: Subroutine questionby jreades (Friar) |
on Sep 21, 2000 at 07:49 UTC ( [id://33445]=note: print w/replies, xml ) | Need Help?? |
Right, here's what we're saying:
This should do what you want as best as I can tell -- open a file and push into an array (either array 1 or array 2 depending on which iteration) any line that doesn't start with UNKNOW/unknow/#/NONE/none. Your lines
look very strange -- as someone else pointed out, if you're reading in the file line by line (which is what <FILE> implies) then the final split on \n is useless. In addition, you're only assigning the last value of @_ to @array1 (meaning the other values are lost) unless you've undefined $/, in which case you should just use my $file = <FILE> rather than the while loop. Hope this helps.
In Section
Seekers of Perl Wisdom
|
|