Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re-indexing a SQL resultset by id

by metaperl (Curate)
on Jul 08, 2011 at 17:48 UTC ( #913396=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $VAR1 = [
              {
    ...
                'datetime' => '1310146917'
              }
            ];
    
  2. or download this
    [ $id1 => [ { $hashrefs_with_id1 } ... ]
      $id2 => [ { $hashrefs_with_id2 } ... ]
    ]
    
  3. or download this
    $VAR1 = {
              '2446438717782054' => {
    ...
                                      'datetime' => '1309966331'
                                    }
            };
    
  4. or download this
    my @row = $r->hashes; # produce flat format of arrays of hashrefs
    my %row;
    ...
      push @{$row{$row->{id}}}, $row;
    }
    warn Dumper(\%row);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-07-29 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls