Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
sub get_users_array { my ($href, $index) = @_; my @all_users; my @sg_keys = keys %$href; foreach my $key (@sg_keys) { my $rec = $href->{$key}; foreach my $mailbox ( sort keys %{ $rec->[$index] } ) { my $users_ref = $href->{$key}[$index]{$mailbox}; push @all_users, $users_ref; } } return \@all_users; } $users_ref = get_users_array(\%sg_hash, $mbx_index); foreach my $user ( @{$users_ref} ) { my $to = $user."@".$domain; my $from = $user->[0]."@".$domain; if ($::Debug) { print "INFO: Sending email to $to\n" } my $msg = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Type => 'multipart/mixed' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fun w/ Elaborate data structures
by poj (Abbot) on Feb 08, 2003 at 17:30 UTC | |
by ebodine (Novice) on Feb 08, 2003 at 22:44 UTC |