Help for this page

Select Code to Download


  1. or download this
        use FileHandle;
        my $fh = new FileHandle;
    ...
        opendir($fh, $dir) or die "Unable to open directory '$dir' ($!)\n"
    +;
        my @files = readdir($fh);
        closedir $fh;
    
  2. or download this
        map { $_ = "$dir/$_" } @files;    # Prepend "/tmp" to all files