Chomp is also a really useful perl function. It strips newline characters (and their ilk) from things.
E.g.
$foo = <STDIN> # Read $foo From STDIN
Chomp($foo); # Remove \n from $foo