Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Comparing 2 arrays but ignoring certain patterns

by hongping (Novice)
on Jun 29, 2012 at 06:53 UTC ( #979051=note: print w/ replies, xml ) Need Help??


in reply to Re: Comparing 2 arrays but ignoring certain patterns
in thread Comparing 2 arrays but ignoring certain patterns

ur script is great, but my @testlist and @removelist may contain more than one word such as:

ctahci_sip11cs_devslp_deto_exp:50:seed ctahci_sip11cs_devslp_deto_exp2:50:seed
therefore the code will assume it is same when one word is matching. How to deal with this?


Comment on Re^2: Comparing 2 arrays but ignoring certain patterns
Download Code
Re^3: Comparing 2 arrays but ignoring certain patterns
by NetWallah (Abbot) on Jun 30, 2012 at 04:36 UTC
    You will need to test out the conditions you expect to work, and define your problem more clearly.

    I tested the patterns you proposed with my code - it works fine.

    If it does not meet your requirements, as I said in my previous post - feel free to modify the regular expression to work with your requirements.

                 I hope life isn't a big joke, because I don't get it.
                       -SNL

Re^3: Comparing 2 arrays but ignoring certain patterns
by AnomalousMonk (Abbot) on Jun 30, 2012 at 13:07 UTC

    I don't understand, especially where you say

    ... @removelist may contain more than one word such as:
    ctahci_sip11cs_devslp_deto_exp:50:seed
    ctahci_sip11cs_devslp_deto_exp2:50:seed

    The string  'ctahci_sip11cs_devslp_deto_exp:50:seed' doesn't look like anything appearing in the  @removelist array in your OPed example code. Can you give an example of data for which NetWallah's code fails?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-10-21 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (105 votes), past polls