I have a situation where I need to read a file full of numbers in Perl. This works fine in and of itself, but when I try to chomp each line it's turning the numbers that used to be 5 or 6 digits into either 1 or 0.
Ideas?
I need to chomp the numbers to assemble file paths with them, so the carriage returns are a problem.
You're not using chomp
like
$line = chomp($line)
are you? The return value of chomp
is the number of characters removed from the input, and not a chomped line of input. Instead you just want to say
chomp($line)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With