roperl has asked for the wisdom of the Perl Monks concerning the following question:
How can I check if $_ is initalized before matching the pattern?find( { wanted => \&get_files, preprocess => \&nodirs }, "$DIR" ) +; sub nodirs { grep !-d, @_; } sub get_files { my @array; push @array, $File::Find::name if ( (/^.*\.($TYPES)$/i) ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Help with $File:Find
by huck (Prior) on Feb 14, 2018 at 18:32 UTC | |
by tinita (Parson) on Feb 14, 2018 at 19:27 UTC | |
by roperl (Beadle) on Feb 14, 2018 at 18:58 UTC | |
Re: Help with $File:Find
by Marshall (Canon) on Feb 14, 2018 at 20:06 UTC | |
by roperl (Beadle) on Feb 14, 2018 at 21:24 UTC | |
by Marshall (Canon) on Feb 15, 2018 at 01:03 UTC | |
by roperl (Beadle) on Feb 16, 2018 at 18:16 UTC | |
by Marshall (Canon) on Feb 16, 2018 at 23:09 UTC | |
| |
Re: Help with $File:Find (rule)
by beech (Parson) on Feb 14, 2018 at 21:28 UTC |