in reply to Re: Execute a for loop in many subdirectories
in thread Execute a for loop in many subdirectories

The depth is only 1, I don't need to go deeper than /antarctica/*

Replies are listed 'Best First'.
Re^3: Execute a for loop in many subdirectories
by runrig (Abbot) on May 22, 2014 at 21:04 UTC
    The depth is only 1, I don't need to go deeper than /antarctica/*
    No need for File::Find then:
    my @dirs = grep -d, </antarctica/*>; for my $dir (@dirs) { chdir($dir) or die "Failed to chdir to $dir: $!"; execute_something(); }