Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Ignore file in array without looping

by hdb (Prior)
on Mar 27, 2013 at 18:17 UTC ( #1025779=note: print w/ replies, xml ) Need Help??

in reply to Ignore file in array without looping

My proposal: build a dynamic pattern from your @array_code

my @array_code = qw(x-01 x-02 x-03 x-04 v-05 v-06 v-07 x-08 x-09 x-10 +x-11); my $pattern = "(".join("|", @array_code ).")"; my @files = qw(1234567_x-01_2013_03.txt 1234667_x-03_2013_03.txt 0034 +567_y-01_2013_03.txt 1234567_v-01_2013_03.txt 233567_v-05_2013_03.tx +t 1234567_x-55_2013_03.txt); for my $file (@files) { next if $file =~ /$pattern/; print $file,"\n"; }

Comment on Re: Ignore file in array without looping
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-11-30 07:33 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (764 votes), past polls