in reply to Using File::Find
find ( thats exported by File::Find ) requires you to define a function that will be used to pick files that you are want. Basic usage like so:
use strict ; use warnings ; use File::Find; use Data::Dump; my $dir = shift || die "Dir name missing as argument\n"; my @files = (); find( \&wanted, "$dir" ); dd( \@files ) ; exit() ; sub wanted() { push @files, $File::Find::name if(/\.txt$/i); # .txt or whatever. }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using File::Find
by arnaud99 (Beadle) on Feb 28, 2013 at 08:52 UTC | |
Re^2: Using File::Find
by Dr Manhattan (Beadle) on Feb 28, 2013 at 08:54 UTC | |
by tobyink (Canon) on Feb 28, 2013 at 09:28 UTC |
In Section
Seekers of Perl Wisdom