Help for this page

Select Code to Download


  1. or download this
          opendir(DIR,$dir_to_open) || die("Cannot open directory !\n");
            @dir_contents= readdir(DIR);
    ...
            if(!(($file eq ".") || ($file eq ".."))){
                 # I want to delete the files 
             }
    
  2. or download this
    use File::Slurp;
    for my $file (grep { -f } read_dir($dir_to_open)) {
          # I want to delete the files 
    }