chomp

Removes newline from a string:

my $ret = `hostname`;
chomp $ret;