Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: structuring data: aka walk first, grok later

by pc88mxer (Vicar)
on May 30, 2008 at 12:25 UTC ( #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
Node Status?
node history
Node Type: note [id://689269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2018-11-18 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (205 votes). Check out past polls.

    Notices?