sub getDirectoryList{ #####################Get list of file in a dir my $dir = shift; my $list = []; opendir(DIR, $dir); while(defined(my $file = readdir(DIR))){ unless ($file eq "." || $file eq ".."){ push @$list,$file; } } closedir DIR; return $list; } sub getFileList{ ################Get list of files from dir my ($dir,$fileList) = @_; my $dirList = getDirectoryList($dir); foreach my $file(@$dirList){ print "checking $dir - $file\n"; ##if it's a directory if (-d "$dir/$file"){ getFileList("$dir/$file",$fileList); } else{ my ($size,$mtime) = (stat "$dir/$file")[7,9]; $fileList->{"$dir/$file"} = { "size" => $size, "mod" => $mtime }; } } }