[tpm] dereferencing arrays

Richard Dice rdice at pobox.com
Fri Jun 27 07:27:41 PDT 2008


>
> 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, ...);
>

Meh?

I haven't looked at the docs for Net::SMTP, but this just looks weird to me.

What you're creating within @list is an array wherein the 0-th element is
itself a listref.

Then, you pass a _reference_ to this list?

I would think that what you'd want is...


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

I.e. if Net::SMTP wants a listref, it probably doesn't want a double
listref.

Cheers,
 - Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/toronto-pm/attachments/20080627/4ca7f9f4/attachment.html 


More information about the toronto-pm mailing list