in reply to Loading an array with file names

Path::Tiny is a very good interface to readedir, very good substitute for glob

use Path::Tiny qw/ path cwd /; my $dir = cwd(); my( $first ) = @ARGV; # my @prfiles = grep { $_ eq $first } path( $dir )->children; my @prfiles = path('.')->children( qr/\Q$first\E/ );

File::Find::Rule is the next step up

use File::Find::Rule qw/ find rule /; my( $first ) = @ARGV; my @prfiles = find(file => name => $first, maxdepth => 1, in => '.');

'.' is common name for cwd :)

Now you know :)

Replies are listed 'Best First'.
Re^2: Loading an array with file names (Path::Tiny File::Find::Rule)
by Anonymous Monk on May 05, 2015 at 00:18 UTC