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

Re^2: Deleting elements of one list using another

by suaveant (Parson)
on Aug 02, 2012 at 13:39 UTC ( #985038=note: print w/ replies, xml ) Need Help??

in reply to Re: Deleting elements of one list using another
in thread Deleting elements of one list using another

Right idea but you aren't using anything to anchor the pattern, so you would also match 'JohnABC, CDE, 14'
@arr1 = ("0000007 | John | ABC.txt | 42","0000014 | Jane | XYZ.txt | 3 +4","0000017 | Jessica | GHI.txt | 21", etc); @arr2 = ('0000007', '0000014'); my $re = join('|',@arr2); my @arr3 = grep /^(?:$re)\s/, @arr1; print join("\n",@arr3),"\n";

                - Ant
                - Some of my best work - (1 2 3)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-07-30 03:34 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (264 votes). Check out past polls.