note
leocharre
<p>I am going to approach question from a different angle.<br>
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.
<p>"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...
<p>
<i>I smell poop here.</i><br>
Perl Object Oriented Programming.
<p>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.
<p>Wouldn't it be nicer to interact with ...
<c>
use Seismic;
my $s = new Seismic;
my $lines = $s->lines;
my $line0 = $s->line(0);
my $line1 = $lines->[1];
my $stations = $line0->stations;
my $station0 = $stations->[0];
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;
</c>
<p>You can then rearrange your code, change your hash hierarchy, and it won't change your scripts using it, etc!
<p>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.
<p>This is what OO is for, this is what computers are for, not people, imho.
<p>Putting the extra week or two to learn some OO and implement it here- will save you countless hours later.
684046
684046