my %fileInfo; find(...); sub wanted { ... $fileInfo{$fileName} = $fileName; }