in reply to Regex Or Die!
use Carp::Assert; while (<>) { assert( /^(foo|bar)/ ); my $dumb_example = $1; .... .... } [download]