Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Coming across an issue with glob. Is only able to find every other directory.

by jwkrahn (Monsignor)
on Jul 07, 2013 at 06:05 UTC ( #1042971=note: print w/replies, xml ) Need Help??


in reply to Coming across an issue with glob. Is only able to find every other directory.

You should use glob like this:

my $UNIT_DIR = '/home/vize/units'; # Get all units in $UNIT_DIR foreach my $moving_code_dir ( <$UNIT_DIR/*/moving_code_*> ) { my $moving_code = ( split '/', $moving_code_dir )[ -1 ]; if ( $moving_code_dir ) { print "$unit good\n"; } else { print "$unit bad\n"; } }
  • Comment on Re: Coming across an issue with glob. Is only able to find every other directory.
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-10-01 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (3 votes). Check out past polls.