Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: structuring data: aka walk first, grok later

by pc88mxer (Vicar)
on May 30, 2008 at 16:25 UTC ( [id://689269]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $DATA_X;
    my $DATA_Y;
    ...
      push(@{$DATA_X->{$obs}->{$det}}, $x);
      push(@{$DATA_Y->{$obs}->{$det}}, $y);
    }
    
  2. or download this
    my $DATA;
    while (<>) {
      my ($obs, $det, $x, $y) = split(' ', $_);
      push(@{$DATA->{$obs}->{$det}}, {x => $x, y => $y});
    }
    
  3. or download this
    print $DATA->{21}->{'DET-2'}->[0]->{x}; # prints 896.657564735788
    print $DATA->{47}->{'DET-7'}->[1]->{y}; # prints 519.649226713148
    

Log In?
Username:
Password:

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

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

    No recent polls found