I have code that iterates over lines in a file and tries to print each line with something added at the beginning and end.
However, I get the conclusion as follows: "rated cows."
Basically, a bit after a line (nominal) overwrites its beginning. I know that deleting the chomp and regex lines stops this effect, but I need it to be on the same line without spaces. Where am I mistaken?
while ($line = <INPUT>) { chomp $line; $line =~ s/ //g; printf "\@attribute %s nominal\n", $line; }
source share