I am going to approach question from a different angle.
I am going to assume by "would then be accessed as" and by "Is there an easier, more efficient way to do this?" you may be talking about interface more then performance.
"accessed as" wreaks of api, as does 'easier'.
I'm going to imagine that efficient means you want to be able to remain efficient in your job as in you don't want to go insane in 6 months- and create something important that only you know how to use...
I smell poop here.
Perl Object Oriented Programming.
I am trying to suggest that.. let your code be all nuts and creepy.. but.. provide an object oriented interface.
Then later on you can worry about the innards and not change the interface.
Wouldn't it be nicer to interact with ...
my $s = new Seismic;
my $lines = $s->lines;
my $line0 = $s->line(0);
my $line1 = $lines->;
my $stations = $line0->stations;
my $station0 = $stations->;
my $station1 = $s->line(0)->station(1);
my $x = $station0->easting;
my $y = $station0->northing;
my $z = $station0->elevation;
my ($x,$y,$z) = $station1->xyz;
You can then rearrange your code, change your hash hierarchy, and it won't change your scripts using it, etc!
I've done some crazy hash stuff like this before- and looking back, this is stuff that's a nightmare to maintain interaction with. The interface really should be separated from the innards.
This is what OO is for, this is what computers are for, not people, imho.
Putting the extra week or two to learn some OO and implement it here- will save you countless hours later.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||