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