[tpm] dereferencing arrays

Emil Janev ejanev at gmail.com
Fri Jun 27 07:26:55 PDT 2008


Hi Fulko,

Most probably you are thinking right but typing wrong :)

Why don't you try:

@list = ('1.2.3.4', '2.3.4.5');

instead of

@list = ['1.2.3.4', '2.3.4.5'];

Regards,
Emil


On Fri, Jun 27, 2008 at 10:19 AM, Fulko Hew <fulko.hew at gmail.com> wrote:
> 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
>
>
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
>



-- 
Emil Janev


More information about the toronto-pm mailing list