in reply to Regex to check for beginning character
=~ says: matches regex
!~ says: does not match regex
The latter stopping on first match.print "yahoo!\n" if grep /^#/ , @lines; # or for ( @lines ) { if ( /^#/ ) { print "yahoo!\n"; last; } }
Cheers - LR
|
|---|