in reply to Quarms with RegEx

I haven't checked this really but what springs into my eyes is the line
if ($curline !~ /^#\s/ or $curline !~ /^\s/)
Shouldn't that be a and instead of an or?

Please note that this is more a kind of intuitive debugging...

Regards... Stefan