Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Reconcile one list against another

by jpl (Monk)
on May 04, 2011 at 18:53 UTC ( #902972=note: print w/replies, xml ) Need Help??


in reply to Re: Reconcile one list against another
in thread Reconcile one list against another

This will do what the OP said he wanted to do, but should user ed match a line for user ted or fred. The OP will probably be better off isolating (just) the user names from both files, then doing exact matching.
  • Comment on Re^2: Reconcile one list against another

Replies are listed 'Best First'.
Re^3: Reconcile one list against another
by wind (Priest) on May 04, 2011 at 18:59 UTC

    That is true, my code was just meant to solve is state variable quandary.

    Without thinking too deeply about it, your noted problem might be solved by simply adding some word boundaries:

    if (my @matched = grep {$line =~ /\b\Q$_\E\b/i} @users) {

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2023-03-24 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (61 votes). Check out past polls.

    Notices?