in reply to Closing program when end of files is reached
This turns comment-only lines into blank lines, and then skips any blank lines in the file (not just the last line of the file).while (<FILE>) { chomp; s/^\s*#.*//; # remove comment-only lines next if /^$/; # skip blank lines (or, commented out lines) do_something_with($_); }
Is this what you're looking for?
Alan
|
|---|