in reply to delete blank lines in a txt file

you need to make it a global replace, by adding a modifier, ie:
s/\n//g;

That's assuming you have the whole file in a string. If you have it in an array, use grep to do it:

@array = grep /\S/, @array;

Where \S represents a non space character - ie, only keep lines that contain non-space characters.

cLive ;-)