<%once> my $meta_prettyprint_age= sub { my ($age,$floor,$plus) = @_; return <('$age','floor','.').' }; ' or die "$@"; <%perl> my $now= time; my $row; my $sth= $dbh->prepare("SELECT archipelago, islandid, islandname, timestamp FROM uploads NATURAL JOIN islands ORDER BY archipelago, islandid"); $sth->execute(); % while ($row=$sth->fetchrow_hashref) { % my $elid= "daid_$row->{'islandid'}"; % my $age= $now - $row->{'timestamp'}; % }
Archipelago Island Age
<% $row->{'archipelago'} |h %> <% $row->{'islandname'} |h %> <% $prettyprint_age->($age) %>

Time since this page loaded: (not known; times above not updating)

% foreach my $a (keys %ARGS) { % }
<%init> use POSIX; use CommodsWeb; my $dbh= dbw_connect('Midnight');