foreach(@lines) { if ($_ !=~ m/^#/g) { print "yahoo!"; } }