This is a best practices question.
I'm not supposed to use unless. So what's the best way to do this:
?while (<>) { unless (/^(foo|bar)/) { die "I can't handle this crap! '$_'\n"; } my $dumb_example = $1; .... .... }
I think:
looks like poop.if ( $_ !~ /^(foo|bar)/ ) { die "What the heck?!\n"; }
In reply to Regex Or Die! by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |