Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 wandering the Monastery: (5)
As of 2015-08-01 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls