Replace $line with whatever variable you are storing the line in. (In this case, $_)
Also, you should probably print the modified lines to the output file at some point inside the loop.
PS: use warnings; use strict;, and opens in the form of open my $filehandle, '<', $filename or die "I couldn't open the file. OS says: $!"; will help highlight likely mistakes in your code and illuminate the reasons for any file errors.
In reply to Re^3: How to have perl check line length
by SuicideJunkie
in thread How to have perl check line length
by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |