=~ 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
In reply to Re: Regex to check for beginning character
by Limbic~Region
in thread Regex to check for beginning character
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |