Why don't you just strip off everything starting with #?
$line =~ s!#.*$!!; # strip off comments my( $key, $value ) = split /=/, $line;
In reply to Re^3: Regex to ignore comment
by Corion
in thread Regex to ignore comment
by crusty_collins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |