Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Regexp Legibility

by patrickhaller (Initiate)
on Jun 14, 2009 at 05:21 UTC ( #771344=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $complex_re = /^($ip) ($host) ($msg)$/ if (
        $ip   = /\d+\.\d+\.\d+\.\d+/,
        $host = /[\-\.\w]+/,
        $msg  = /.*/
    );
    
  2. or download this
    my $complex_re = eval {
        my $ip   = qr/\d+\.\d+\.\d+\.\d+/;
    ...
    
        return /^($ip) ($host) ($msg)$/;
    );
    
  3. or download this
                     Rate    with eval without eval
    with eval    116279/s           --          -5%
    without eval 121951/s           5%           --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-08-29 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls