in reply to Re: Printing all the files that have both ".rtf" and ".ftp" by searching recursively in a given directory
in thread Printing all the files that have both ".rtf" and ".ftp" by searching recursively in a given directory
use Filesys::Tree qw/tree/; my $sysTree = tree({ 'full' => 1,'max-depth' => 3,'pattern' => qr/\.rt +f|\.ftp$/ } ,'.'); files($sysTree); sub files { my %treeree = %{+shift}; for (keys %tree) { if ($tree{$_}->{type} eq 'f'){ print $_,"\n" }elsif ($tree{$_}->{type} eq 'd') { files($tree{$_}->{contents}); } } }
|
|---|