#chomp() EXAMPLES $a = "abcdefghij"; chomp($a); print $a; #would return exact string... nothing to remove $a = "abcdefghij\n"; chomp($a); print $a; #would return 'abcdefghij', removed newline $a = "abcdefghij\n"; $b = chomp($a); print $b; #would return 1, it did remove something for sure #chop() EXAMPLES $a = "abcdefghij"; chop($a); print $a; #this would return 'abcdefghi' $a = "abcdefghij"; $b = chop($a); print $b; #this would return 'j' #### $a = "abcdefghij\n"; if ($a =~ /\n$/) { chop $a; } #this could also be \r\n if on windows platform