in reply to Regex to check for beginning character

Anonymous Monk,

=~ says: matches regex
!~ says: does not match regex

See perldoc perlop for more info. Either of the following should work:
print "yahoo!\n" if grep /^#/ , @lines; # or for ( @lines ) { if ( /^#/ ) { print "yahoo!\n"; last; } }
The latter stopping on first match.

Cheers - LR