On Thu, Mar 17, 2005 at 06:11:09PM -0500, Aaron Sherman wrote:
:         =head2 Obsolete
: 
:         =item chop
: 
: Chop removes the last character from a string. Is that no longer useful,
: or has chomp simply replaced its most common usage?

I expect chop still has its uses.  Also, since $/ is going away, the
meaning of chomp will probably change from chomping $/ to removing
whatever was marked as the terminator by the input layer (which
could even vary from line to line if the terminator was specified
as a pattern).  But mostly people will just have the input layer
autochomp so they never see the delimiter.  (The chomped delimiter
could maybe be attached to the line as a property in case you're
interested, if that's not too high an overhead.)

Autochomping is one of the motivations for switching from "while" to
"for" for the normal line input method, since "while" might think a
blank line is false, while "for" only cares whether the next value
is defined.

Larry

Reply via email to