If the "other things" in your program are all happening inside a while loop like this:
while (<>) { # or maybe using a file handle, like <IN>
# do stuff...
}
and you just want to skip lines that start with a semi-colon, then just add one line at the top of the loop like this:
while (<>) {
next if ( /^\s*;/ ); # skip if first non-space char is ";"
# now do stuff...
}
If you also want to delete lines with double semi-colons (because these represent empty fields), adjust that first line within the loop as follows:
while (<>) {
next if ( /^\s*;/ or /;;/ );
# now do stuff...
}
The "next" statement simply causes the script to skip everything that follows in the loop, and go right to the next iteration. The regular expressions in the "if" statement are saying:
^ -- 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
|