in reply to How do I remove blank lines from text files?

Don't forget that our friend next will work in a while loop. Combining some of these answers gets you the technique I prefer:
while (<FILE>) { next if /^#/; # skip lines starting with comments next unless /\S/; # do something with a real line here }
This allows you to use a normal loop construct (makes sense to me) and short-circuit it at the beginning if certain conditions are met. It makes cleaner code than a lot of if-elsif statements.