Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 having an uproarious good time at the Monastery: (13)
As of 2016-06-25 13:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (325 votes). Check out past polls.