I may not be up to "Perlmonk" status yet. So I am assuming I am missing the problem, but if I wanted to test to make sure something didn't start with something I would use a little boolean if logic, like so :
if ($string !~ /^#/) {
print "Houston, we have an uncommented line \n";
}