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

Re: Re: Records question

by dave8775 (Novice)
on Jan 11, 2003 at 00:56 UTC ( #226019=note: print w/ replies, xml ) Need Help??


in reply to Re: Records question
in thread Records question

Great! That is definatelly quick (and simpler). :) Nonetheless to complete my code I will eventually have to access that data... and since it is nested and requires a long trail to get to the inner data is it considered easier or more common practice to simply store the data in an array and separate field values and records with some delimeter? Or am I on a good track (records is good for this and it won't be to difficult to get at the data)?

thanks!


Comment on Re: Re: Records question
Re: Re: Re: Records question
by blokhead (Monsignor) on Jan 11, 2003 at 01:30 UTC
    Delimited data organization might seem tempting, especially if the concept of references is a little foreign. But I think you will find that in general, manipulating data internally using records is good, and internally using just delimited data in an array is bad, unless your data is very simple. In a complex record structure, each atom of data has a location, which can't be said for the delimited data; it requires you to create temporary variables and use split every time you need access to something. There is also the problem of quoting/escaping data so it doesn't interfere with the delimiter. Given that your record structure is intelligently organized (it seems that way so far), you really can't go wrong. Once you really come to understand Perl's way of handling references, you will find very little data that you can't model inside your program with complex structures. The same can't be said for a delimited array.

    See perlreftut for more info.

    blokhead

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2013-06-20 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many continents have you visited?









    Results (680 votes), past polls