in reply to removing blank lines from files

To get rid of lines containing nothing at all you could do something like this:
#!/usr/bin/perl -w use strict; while (<>) { next if (/^\n/); print; }
where the regex matches lines which start with a newline chartacter. If you also wanted to ignore lines which contained only spaces you could try replacing the regex line with
next if (/^\s*$/);