Help for this page

Select Code to Download


  1. or download this
    use File::Spec::Functions qw/ no_upwards catfile catdir /;
    opendir my $dh, $path or die "$path: $!";
    my @files = map { -d catdir($path,$_) ? catdir($path,$_)
        : catfile($path,$_) } sort +no_upwards readdir $dh;
    closedir $dh;
    
  2. or download this
    use Path::Class;
    my @files = dir($path)->children();
    # - or - 
    my @files = dir($path)->absolute->children();