Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Array of Hashes to Hash of arrays for SQL::Abstract

by kcott (Archbishop)
on Mar 19, 2020 at 07:46 UTC ( [id://11114456]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
    }
    
    dd \%columns;
    
  2. or download this
    {
      a => [1, 3, undef, undef, undef],
      b => [undef, 4, undef, 8, undef],
      c => [undef, undef, undef, undef, 9],
    }
    
  3. or download this
    push @{$columns{$_}}, $row->{$_} // '' for @uniq_keys;
    
  4. or download this
    push @{$columns{$_}}, defined($row->{$_}) ? $row->{$_} : '' for @uniq_
    +keys;
    
  5. or download this
    {
      a => [1, 3, "", "", ""],
      b => ["", 4, "", 8, ""],
      c => ["", "", "", "", 9],
    }
    
  6. or download this
    my $sql= new SQL::Abstract( array_datatypes => 1 );
    
  7. or download this
    my $sql = SQL::Abstract::->new(array_datatypes => 1);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-03-28 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found