print "Enter the common character in the batch file:\n"; chomp(my $f = ); print "Enter the number in the last batch file:\n"; chomp(my $l=); # Now both $f and $l have no trailing newline