Help for this page

Select Code to Download


  1. or download this
    foreach $key (sort {$a <=> $b} keys %myhash) {
         do stuff;
    }
    
  2. or download this
    $sql = "SELECT record_id, attribute_1, attribute_2 FROM theTable";
    $sth = $dbh->prepare($sql) or die("Could not prepare!" . $dbh->errstr)
    +;
    ...
    $template->process($template_file, $vars)
        || die "Template process failed: ", $template->error(), "\n";
    
  3. or download this
    <table class="myClass">
    [% FOREACH record_id IN data_hash.keys.sort.reverse %]
         <tr><td>$data_hash.$record_id.att_1</td><td>$data_hash.$record_id
    +.att_2</td></tr>
    [% END %]
    </table>