in reply to removing blank lines from files

chomp will remove any trailing string that corresponds to the value of $/ (see perlfunc). So you want something like s/^\s*$//g. Some code would be helpful here by the way.