[Mpls-pm] Dereferencing complicated things...
Eric Estabrooks
eric at urbanrage.com
Tue Dec 6 19:36:47 PST 2005
Dave Dash wrote:
> Let's say I have a hash:
>
> $a = {b=>(1,2,3)}
>
> and
>
> $b = \$a;
>
> Is there a way given $b->{b} to dereference that into the array that
> is (1,2,3) ?
>
> Currently I end up doing a lot of annoying steps, but it'd be nice if
> something like @($b->{b}) would work...
>
well you could do:
$a = {'b'=>[1,2,3]};
$b = \$a;
@c = @{$$b->{'b'}};
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3174 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.pm.org/pipermail/mpls-pm/attachments/20051207/86d5e1ad/smime.bin
More information about the Mpls-pm
mailing list