Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-02-01 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    On my keyboard, Caps lock is:








    Results (15 votes), past polls