[tpm] dereferencing arrays

Fulko Hew fulko.hew at gmail.com
Fri Jun 27 07:19:42 PDT 2008


I'm brain dead today, because I can't get this to work...

Net::SMTP...

My problem is that Net::SMTP takes an argument for the destination
host to send mail to.  In some cases that destination FQDN resolves
into a list of actual IP addresses.  Net::SMTP isn't smart enough to
resolve that name and traverse that list itself.  So...  I build by own list
and pass it in (the docs says I can).  My trouble is that I'm not
doing it right.

The routine that gets called in the end looks like this:

my $host = shift;
foreach $h (@{$host}) { ... }

So the docs say pass in a reference to an array (containing the list)

@list = ['1.2.3.4', '2.3.4.5'];
Net::SMTP->new(\@list, ...);

This causes the receiving end to think it has one entity which is the
reference to the array.

What am I missing?

TIA
Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/toronto-pm/attachments/20080627/4b2e4d55/attachment.html 


More information about the toronto-pm mailing list