Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Regexp works with some elements and doesn't with others

by mickeyn (Priest)
on Feb 07, 2006 at 10:54 UTC ( [id://528469]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regexp works with some elements and doesn't with others
in thread Regexp works with some elements and doesn't with others

Well ... wrong assumption!

you can do it with 'grep' with the help of 'map':

my @tmp = grep { $_->[0] !~ /^The website has been restructured/ } map + { [$text[$_], $arr2[$_], $_] } ( 1 .. $#text ); my @text = map { $_->[0] } @tmp; my @arr2 = map { $_->[1] } @tmp; undef @tmp;
note - this way you create temporary structures (map & grep), so I wouldn't use it on large arrays, but since you wrote it's a 50 elements array ... I guess you can consider this sollution.

Enjoy,
Mickey

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-25 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found