Help for this page
#keep based on pattern match opendir(DIR, $destinationDirectory) or die $!; ... next if -d $file;#skip directory entries unlink unless $file =~ /$pattern/; }
#keep based on a prepopulated hash %prepopulatedHash =(FILE1 => 1, FILE2 => 1, FILEN => 1); ... next if -d $file;#skip directory entries unlink unless exists($prepopulatedKeepHash{$file}; }