Feb 032009
Remove newline character from the end of a string in Perl
Answer:
chomp() is useful when reading data from a file or from a user - it remove remove any newline character from the end of a string.
E.g.
while (my $text = ) {
chomp($text);
print "You entered '$text'\n"; # newline from input is removed
}