Your regular expression isn't correct, in a few ways:
-
my ($enabled) = /([^\s#]+)#/; doesn't work, because it specifies that there can't be any spaces between the valid text and the #. Add \s*.
- To catch lines that aren't commented at all, change # to #?
- Now you'll wind up matching "acommentedoutline" in "#acommentedoutline".
Block that by adding ^\s* to the start of the regexp; now the match has to be between the start of the line and the first #, if there is one.
-- Frag.
--
"Just remember what ol' Jack Burton does when the earth quakes, the poison arrows fall from the sky, and the pillars of Heaven shake. Yeah, Jack Burton just looks that big old storm right in the eye and says, "Give me your best shot. I can take it."