in reply to Re: Re: split loop error
in thread split loop error

There we go. It's very likely that it may be a bug. You're using one of those common idioms that a lot of people (including me), simply don't like. Here's how I'd write it (see <> in `perldoc perlop'):
while(my $line = <>){ ... }
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>).

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.