sub add { my ($hashref, $to, $subject, $file_name, $from, $last_dir) = @_; $hashref -> {$to} ||= { }; $hashref -> {$to} {$subject} ||= [ ]; push @{$hashref -> {$to} {$subject}} => {$file_name => {path => $last_dir, from => $from}}; } #### add $spam, 'foo@bar.com', 'New CDs now', 'AAAAA.txt', 'that@person.com', 'Spam';