Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Matching against list of patterns

by diotalevi (Canon)
on Sep 16, 2004 at 15:54 UTC ( #391491=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Precompile all the patterns and store them into the key
    # CompiledPattern
    $_->{'CompiledPattern'} = qr/$_->{'Pattern'}/i for values %$users;
    ...
            warn "$line didn't match any users.\n";
        }
    }
    
  2. or download this
    use List::Util 'first';
    
    # Precompile all the patterns and store them into the key
    ...
            warn "$line didn't match any users.\n";
        }
    }
    
  3. or download this
    # Precompile all the patterns and store them into the key CompiledPatt
    +ern
    $_->{'CompiledPattern'} = qr/$_->{'Pattern'}/i for values %$users;
    
    ...
            warn "$line didn't match any users.\n";
        }
    }
    
  4. or download this
    # Precompile all the patterns and store them into the key
    # CompiledPattern
    $_->{'CompiledPattern'} = qr/$_->{'Pattern'}/i for values %$users;
    ...
            warn "$line didn't match any users.\n";
        }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-09-02 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls