in reply to Formatting The Communist Manifesto

Actually, this could be to do with the finding of a '0' in the data, which could cause the while loop to fail, I think I remember perl treats characters of numbers as real numbers...

either that or it's the getc, which may pose problems, apparently not a good idea to rely on it in perl

Replies are listed 'Best First'.
Re^2: Formatting The Communist Manifesto
by bart (Canon) on Apr 06, 2007 at 16:56 UTC
    either that or it's the getc, which may pose problems, apparently not a good idea to rely on it in perl
    Instead, you should stop trying to parse one character at a time. If you split on newlines, just fetch one line at a time.
Re: Formatting The Communist Manifesto
by jonadab (Parson) on Apr 06, 2007 at 20:37 UTC
    either that or it's the getc, which may pose problems, apparently not a good idea to rely on it in perl

    Indeed, I think in Perl, and I was not aware that Perl even had a getc function. With a name like that I'd lay odds ten to one that it just wraps the function of the same name in the C library, and if so, I don't want anything to do with it. Just thinking about the prospect makes me want to take a shower (as does looking at that code -- somebody apparently took six lines of nice clear legible Perl code and ran it through an extreme verbosification cycle).