Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: An optimization of last resort: eliminate capturing from your regexps

by demerphq (Chancellor)
on Jul 11, 2006 at 08:43 UTC ( [id://560360]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str =~ /Hulk hate (\w+)/k;
    
  2. or download this
    if ($str =~ /Hulk hate (\w+)/k) {
       $str='demons!';
       print $1; # could and probably would throw fatal error.
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://560360]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found