in reply to When do you use chop instead of chomp?

chomp will only remove any trailing string that corresponds to the current value of $/ usually the "newline" character whereas chop will remove the last character regardless of what it is. The benifit of using chop is that it is much faster since it does not try to scan the string and match the value of $/

See also chop() and chomp()


<cite>Just a tongue-tied, twisted, earth-bound misfit. -- Pink Floyd</cite>