- or download this
my %hash;
my %rec;
...
while ($sth->fetch) {
$hash{$rec{week}} = [ $rec{month}, $rec{workperiod} ];
}
- or download this
my %hash;
my $sth = $db->prepare ("select week, month, workperiod from tablename
+");
...
while ($sth->fetch) {
$hash{$week} = [ $month, $workperiod ];
}
- or download this
my $dbh = DBI->connect ("dbi:$driver:", "user", "pass", { FetchHashKey
+Name => "NAME_lc" });
my %hash;
...
while (my $rec = $sth->fetchrow_hashref) {
$hash{$rec->{week}} = [ $rec->{month}, $rec->{workperiod} ];
}