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

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 scrutinizing the Monastery: (3)
As of 2016-02-07 00:14 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (238 votes), past polls