[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Complex data structure building



I realize this is a bit of a general question, but I thought some here
might have some solutions.

One of the things I used to love about the Think C debugger was that it
allowed me to figure out complex dereferences.  Need to know how a pointer
to a record containing a pointer to an array would look?  Just play around
with it in the debugger until you hit on the combination that displays the
proper data.  Hmm...*myrec->array[0] doesn't work...maybe it's
(*(myrec->array))[0]....things like that.

I'm having difficulty understanding how to build and reference complex data
structures in Perl.  Now, generally, I'm a pretty bright guy, but the idea
of references just hasn't clicked yet.  I've read all the man pages, the
Camelbook, etc, but I'm still struggling.  Let's see..should that be
$myarray[0][0], $myarray->[0][0] or @$myarray[0][0]?

In short, other than trying "print somecombination" until I get the right
data printed, does anyone have any tips for either tools to help you
reference complex structures correctly, or any pointers to any more
tutorial information which can help me get over the hump on the whole
references/complex structures issue.

Many thanks,

Wade
---------------------------------------------------------------------------
Wade Williams                      "Put your message in a modem, and throw
Systems Engineer, CCIE #3373        it in the cyber sea."
Cisco Systems, Inc.                       - N. Peart
Brentwood, TN                        
615-221-2918                             
wwilliam@cisco.com    
---------------------------------------------------------------------------

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch