while (<>) { next if /^\s*\#/; # comment next if /^\s*$/; # empty line do_the_work($_); } #### while (<>) { if (not /^\s*\#/ and not /^\s*$/) { do_the_work($_); } }