Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Matching against list of patterns

by diotalevi (Canon)
on Sep 16, 2004 at 15:54 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://391491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-16 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found