Jeff 'Japhy' Pinyan wrote:
> 
> On Feb 20, Kevin Old said:
> 
> >                if($a =~ qw/sorry/) { $sorry = 1; last SWITCH; }
> >                if($a =~ qw/kevin/) { $kevin = 1; last SWITCH; }
> >                if($a =~ qw/larry/) { $larry = 1; last SWITCH;}
> 
> Uh, qw// is not the right thing to use there.  Perhaps q// or qq// or
> qr//.  Or, better yet, m//.  Or just //, since the 'm' is optional.

Also, since a regex returns true or false in a scalar context you can
simplify this to:

               last SWITCH if $sorry = $a =~ /sorry/;
               last SWITCH if $kevin = $a =~ /kevin/;
               last SWITCH if $larry = $a =~ /larry/;

:-)

John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to