On Mon, 30 Jul 2001, Robb Wagoner wrote:

> I have a two dimensional array where each element consists of a reference to
> an anonymous array.
>
>       push(@array,[$var1,$var2,$var3]);
>
> When I pass a reference to the array in a subroutine:
>
>       some_sub(\@array);
>
> What is the proper way to dereference the array with in the subroutine?
>
> After much monkeying I was able to get this to work:
>
>       @{$_}->[0][0]

No need to monkey around, this is well documented in the perlref POD.

some_sub(\@array);

sub some_sub {

  my $arr = shift;

  my $var = $arr->[0][0];

  # etc etc etc
}

-- Brett

Brett W. McCoy
Software Engineer
Broadsoft, Inc.
240-364-5225
[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to