perlquestion
Anonymous Monk
I'm trying to print a table sorted by the date. The date format I'm using is #.#.## or #.##.##. For example $date = "1.13.04";.<p>
How can I get these to print in reverse order by date so the newest date is on top? It may be confusing, but I have a whole mess of records in my SDBM that are dated, I need to bring them back out in a new order.<p>
The tricker part would be after seperating by date, how can I make it prints a new table for each month? For example:
<code>
foreach (reverse sort keys %list) {
<table>
<tr><td>1.1.04</td><td>first record</td></tr>
<tr><td>1.21.04</td><td>next record, same month</td></tr>
</table>
<table>
<tr><td>2.13.04</td><td>New table becuse it's a new month</td></tr>
</table>
}
</code>
Any help would be very much appreciated.
9