in reply to Re: Re: Why is part of slice duplicated?
in thread Why is part of slice duplicated?

Do something like:
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}}; }
And call it like:
add $spam, 'foo@bar.com', 'New CDs now', 'AAAAA.txt', 'that@person.com +', 'Spam';

Abigail

Replies are listed 'Best First'.
Re: Re: Why is part of slice duplicated?
by the_0ne (Pilgrim) on May 28, 2002 at 18:59 UTC
    Wow, that's exactly what I needed and it works perfectly also. Need to get back to the books on advanced data structures now. Also have a lot of changing to do to the larger script that is based on this structure

    Thank you very much for your help. Wish I could give more than one ++ for this reply.