Untested
#!/usr/local/bin/perl use strict; open( FILE, "file" ) || die $!; while( <FILE> ) { if( /regexp/ ) { print; last; } }
or better yet ( also untested )
perl -ne 'print, last if /regexp/' file
In reply to Re: fastest pattern match
by lestrrat
in thread fastest pattern match
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |