Chop and chomp in perl

Ricky Moorhouse September 16, 2008
Source
Just a reminder, so I remember the difference! - chomp is a safer version of "chop" removes any trailing string that matches what perl thinks is a new line) $string = "abcdef"; chop($string) $s is now f, $string is now abcde chomp($string) $string is still now abcde $string = "abcdefn"; chomp($string) $string is now abcdef

Discussion in the ATmosphere

Loading comments...