in reply to Re: Unique array w/o repeated elements and still keep the original order!
in thread Unique array w/o repeated elements and still keep the original order!
That won't work how you expect it to...
Particularly, what's happening to $_? It's getting set by the while loop and then forgotten about, which is to say that you'll not process all of the lines. Oops. How about this:
Or alternately you could check for file EOF in the while condition like so:while (my $line_holder = <FILE>) { foreach etc...
Either way should fix the problem...while (! eof(FILE)) { my $line_holder = <FILE>; foreach etc...
jynx
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Unique array w/o repeated elements and still keep the original order!
by TexasTess (Beadle) on Aug 09, 2002 at 20:34 UTC | |
by DamnDirtyApe (Curate) on Aug 09, 2002 at 20:46 UTC | |
by demerphq (Chancellor) on Aug 09, 2002 at 21:05 UTC | |
by jynx (Priest) on Aug 09, 2002 at 21:17 UTC | |
by demerphq (Chancellor) on Aug 09, 2002 at 21:28 UTC |
In Section
Seekers of Perl Wisdom