Try
#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; use Data::Dump qw/ dd /; my @files = path( "/opt/temp" )->children; dd( \@files ); @files = grep { =T $_ } @files; dd( \@files ); __END__
Path::Tiny will throw an exception if permission is denied, just like the soldiers at Fort Knox :)
In reply to Re: Perl List files in directory
by Anonymous Monk
in thread Perl List files in directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |