in reply to Removing white-lines...

foreach my $line (@data) { #Work to be done on each line of the file $file_data .= $line if ( $line =~ /\S/ ); }

This way, a line is only added to the $file_data if it has a character that is not white space.