while (<>) { # or maybe using a file handle, like # do stuff... } #### while (<>) { next if ( /^\s*;/ ); # skip if first non-space char is ";" # now do stuff... } #### while (<>) { next if ( /^\s*;/ or /;;/ ); # now do stuff... } #### ^ -- line begins with... \s* -- zero or more white-space characters ; -- followed by a semi-colon or ;; -- there are two semi-colons together anywhere in the line