in reply to Re: Re: file::find question
in thread file::find question
Don't be afraid to use 'my' variables for purposes such as this. It is the very natural, perlish thing to do.sub find_files(&@) { my( $criteria_cr, @dirs ) = @_; my @found; find( sub { $criteria_cr->( $File::Find::name ) and push @found, $File::Find::name; }, @dirs ); @found } # then you could call it like this: my @html_files = find_files { /\.html$/ } '.'; my @abc_subdirs = find_files { -d $_[0] } 'a', 'b', 'c';
jdporter
...porque es dificil estar guapo y blanco.
|
|---|