sub AllInFilesystemResults { my ($class) = shift; my ($collectArchive) = shift; my @searchLocations; if ( $collectArchive =~ /^archive/ ) { @searchLocations = "/vol/$collectArchive/prod/*"; } else { @searchLocations = ( "/vol/archive*/prod/*/$collectArchive/*", "/vol/archive*/prod/system/archive/$collectArchive/*" ); } my %listOfFilesDatabase; foreach my $searchLocation (@searchLocations) { my @archivesInFilesystem = `find $searchLocation -type f 2> /dev/null | grep -v \"\/archive\/archive\/\"`; chomp @archivesInFilesystem; $searchLocation = qr/$searchLocation/; foreach my $locationFS (@archivesInFilesystem) { print "$locationFS\n"; utf8::decode($locationFS); $listOfFilesDatabase{$locationFS}++; } } return %listOfFilesDatabase; }