Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

True. Don't be apprehensive about depth/complexity. A comment line or two may be sufficient to document the structure if you need to go back and tweak it. Here's a one line comment from something I wrote several months ago.

polls->{lane:stage}->[row]->[col]

This is sufficient to remind me how the data is organized. Polls are polling cycles over time for chip insertion machines which may have one or two lanes/stages. The row/col are defined by a header row of words for the column labels. Values corresponding to those header row words are in subsequent rows.

This also illustrates one thing I frequently do. I often use and store my hashes and arrays as refs. This makes it easy to pass everything as a scaler. For example, I have one package to handle the processing of one part of the data. If I need to store that, I just get and store the ref to combine the individual pieces to a higher level. This type of organization allows the use of OO concepts others have mentioned, but does not break/remove the built-in features for using arrays or hashes. If all of your data is in one file, this may not be needed. But, it is a handy pattern that can be used in other situations.


In reply to Re^4: Data Structures by TimButterfield
in thread Data Structures by YYCseismic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found