Sorry for the sloppy code, however, this comes from a very large script and just to figure this part out I wrote this code into a separate smaller script for debugging.$to = "foo\@bar.com"; $subject = "New CDs now"; $file_name = "AAAAA.txt"; $from = "that\@person.com"; $last_dir = "Spam"; $spam->{$to} = $to; $spam->{$to}->{$subject} = $subject; $spam->{$to}->{$subject}->{$file_name} = $file_name; $spam->{$to}->{$subject}->{$file_name}->{'path'} = $last_dir; $spam->{$to}->{$subject}->{$file_name}->{'from'} = $from; $to = "foo2\@bar.com"; $subject = "New CDs now"; $file_name = "BBBBB.txt"; $from = "that2\@person.com"; $last_dir = "Spam"; $spam->{$to} = $to; $spam->{$to}->{$subject} = $subject; $spam->{$to}->{$subject}->{$file_name} = $file_name; $spam->{$to}->{$subject}->{$file_name}->{'path'} = $last_dir; $spam->{$to}->{$subject}->{$file_name}->{'from'} = $from; print "\n"; for my $email_slice (sort keys %{$spam}) { print "email_slice - $email_slice\n"; for my $subject_slice (sort keys %{$email_slice}) { print "subject_slice - $subject_slice\n"; for my $fn_slice (sort keys %{$subject_slice}) { print "fn_slice - $fn_slice\n"; } } print "\n"; }
Notice how the fn_slice is duplicated? What I'm trying to get is...email_slice - foo2@bar.com subject_slice - New CDs now fn_slice - AAAAA.txt fn_slice - BBBBB.txt email_slice - foo@bar.com subject_slice - New CDs now fn_slice - AAAAA.txt fn_slice - BBBBB.txt
Notice how the AAAAA.txt and BBBBB.txt are separated by their respective email addresses? I can not imagine how the fn_slice is getting duplicated? I think it has something to do with the $subject since it's the same, however, the email_slice should take care of that and separate it.email_slice - foo2@bar.com subject_slice - New CDs now fn_slice - BBBBB.txt email_slice - foo@bar.com subject_slice - New CDs now fn_slice - AAAAA.txt
In reply to Why is part of slice duplicated? by the_0ne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |