Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Reconcile one list against another

by jpl (Monk)
on May 04, 2011 at 18:53 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-06-17 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.