Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 taking refuge in the Monastery: (11)
As of 2014-09-19 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (145 votes), past polls