I'm capturing some output from an external program:
my $cmd = "grep -h $text $file2 $file1 | tail -1 | awk '{print \$NF }' ";
my $port_number;
$port_number =`$cmd`;
print "port No : ==$port_number==";
The output has extra whitespace around the port number:
port No : == 2323
==
and I tried chomp but it's not working.