sub _isGoodFolder { my ($theDate,$datePlusFolder,$attr) = @_; my ($date) = ($datePlusFolder =~ /\/(\d{8})$/); if ($date > $theDate) { ## compare folder date with today return $datePlusFolder; } return ''; } my $today = new Date::Business->image; my $dir = ; my $cwd = Cwd::getCwd(); chdir($dir); my @folderKeys = grep { _isGoodFolder($today,$_) } glob("*/*"); chdir($cwd); return [ map { join ",",(split "\/")[1,0] } @folderKeys ];