in reply to Re: Re: split loop error
in thread split loop error
Unless you're exploiting the magic of <> (you're simply reading of STDIN), or you have no idea there is any magic, i'd suggest you simply read off the filehandle you're using (as in <STDIN>).while(my $line = <>){ ... }
I personally like to go all the way and use defined, as in while(defined(my $line = <>)){...}.
From perldoc perldiag
Split loop(P) The split was looping infinitely. (Obviously, a split shouldn't iterate more times than there are characters of input, which is what happened.) See split in perlfunc.
update: Try $line = "$_"; and see if that works (it may be that somehow $line was being aliased to $_ instead of a copy being made, and that somehow screwed up the length count -- wild guess).
|
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
|
|---|