#!/usr/bin/perl #Programmed by David Thole #Basically this application will go about deleting all the 'temp' files in #my school folder, making reading it much much easier. use File::Find @files_delete; $main_directory="/Users/dthole/School\ Storage/"; #Insert all the stuff into the array, to make sure we get all elements find(\&insertIntoArray, $main_directory); print("List of files to be delete: \n"); $size = $#files_delete + 1; #recursive loop to print the contents of the array for($x = 0; $x < $size; $x++) { print($files_delete[$x] . "\n"); } #Priint the main size: print("Number of elements to be deleted: " . $size ."\n"); if($size > 0) { print("Deleting Files... \n"); unlink @files_delete; print("Complete... \n"); } else { print("No items to delete, exiting \n"); } sub insertIntoArray { if((/\.aux$/) || (/\.log$/)) { push(@files_delete,$File::Find::name); } }