Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Sorting hash values according to order of an array

by mt2k (Hermit)
on Nov 24, 2002 at 01:45 UTC ( [id://215458] : perlquestion . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %TABLES = (      # Hash identifying one database
      'users' => [      # Hash keys are the database's tables
    ...
        'rating'
      ]
    );
    
  2. or download this
    $handle->insert (
      -table        =>  "users",
    ...
        rating        =>  10
      }
    );
    
  3. or download this
    sub insert {
      my ($self, %q) = @_;
    ...
    
      # This is the line that causes problems. Read below for more.
      $sth->execute(values %{$q{'-values'}});