in reply to Regex to check for beginning character

foreach(@lines){ if($_!~/^\#/s){print "does not start with a pound sign";} else{print "begins with a pound sign\n";} }