Help for this page

Select Code to Download


  1. or download this
    $dir = <>; # get directory from STDIN
    $dir =~ s/\//\\/g; # clean up the path a bit
    opendir(DIR,"$dir"); # open directory $dir
    @files = readdir(DIR); # read directory contents into @files
    closedir(DIR);