http://www.perlmonks.org?node_id=1042971


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