Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How can I Compute address of elements of Multidimensional Array

by ariels (Curate)
on May 07, 2002 at 08:24 UTC ( [id://164561]=note: print w/replies, xml ) Need Help??


in reply to How can I Compute address of elements of Multidimensional Array

Perl doesn't let you compute the "address of" anything, really. Even a scalar needn't live in a contiguous block of memory. You're probably thinking of references... And that gives you your answer: just bung a quick `<samp>\</samp>' on the element you want to access:

@x = (1,2,3); @y = (4,5,6); $x = [\@x, \@y]; $r = \$x->[1][2]; $$r = 8;

  • Comment on Re: How can I Compute address of elements of Multidimensional Array
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164561]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-29 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found