I've noticed that perlfunc has some bad advice and examples on the use
of chop, showing and advocating its use as a way to strip newlines
from input.  This is what chomp() is for, of course, and isn't
cross-platform (although perlport doesn't bring it up, odd).

Anyhow, I cut out all the naughty bits from perlfunc, but I can't
think of good chop examples to replace:

                   while (<>) {
                       chop;   # avoid \n on last field
                       @array = split(/:/);
                       #...
                   }

and

                   chop($cwd = `pwd`);
                   chop($answer = <STDIN>);


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Any sufficiently encapsulated hack is no longer a hack.

Reply via email to