in reply to Finding files recursively
use File::Find; my @found; my $path = 'd:\env\videos'; my $target = '2012.avi'; find ( sub { # We're only interested in directories return unless -d $_; # Bail if there is an .ignore here return if -e "$_/.ignore"; # Add to the results if the target is found here push @found, $File::Find::name if -e "$_/$target"; }, $path); print "@found";
D:\ENV>perl pm10.pl d:\env\videos/2012 D:\ENV>echo.>d:\env\videos\2012\.ignore D:\ENV>perl pm10.pl D:\ENV>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding files recursively
by ovedpo15 (Pilgrim) on Aug 04, 2019 at 19:58 UTC | |
by holli (Abbot) on Aug 04, 2019 at 20:20 UTC | |
by ovedpo15 (Pilgrim) on Aug 05, 2019 at 06:40 UTC | |
by holli (Abbot) on Aug 05, 2019 at 08:16 UTC | |
by ovedpo15 (Pilgrim) on Aug 05, 2019 at 17:53 UTC | |
|