Think about Loose Coupling | |
PerlMonks |
Add a newline to the end of a fileby jmcnamara (Monsignor) |
on Nov 28, 2002 at 11:25 UTC ( [id://216282]=CUFP: print w/replies, xml ) | Need Help?? |
Add a missing newline to the end of a file to placate compilers like gcc 3.
gcc 3.x complains if a source or header file doesn't have a newline at the end:
The following snippet will fix that for one or more files: perl -i -pl -eof file1 file2 ... The following is an alternative approach: perl -i -pe '$_ .= $/ if eof and not /\n/' file1 file2 ...
Back to
Cool Uses for Perl
|
|