Guest User

Untitled

a guest
Oct 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. sub list_files {
  2. my ($self, $dir) = @_;
  3.  
  4. # Files relative to directory
  5. my $parts = $self->{parts} || [];
  6. my $root = File::Spec->catdir(@$parts);
  7. $dir = File::Spec->catdir($root, split '/', ($dir || ''));
  8. return [] unless -d $dir;
  9. my @files;
  10. find {
  11. no_chdir => 1,
  12. wanted =>
  13. sub { push @files, File::Spec->abs2rel($File::Find::name, $dir) }
  14. },
  15. $dir;
  16.  
  17. return [sort @files];
  18. }
Add Comment
Please, Sign In to add comment