Your question is a bit confusing but I'll give it a try.
If you are talking about the AnyDBM_File package then that just ties a hash to a file.
If the keys in the file are the epoch time of localtime (the value returned in scalar context) and all you want to do is sort by the keys then here is a loop that will sort the keys...
for (sort {$a <=> $b} keys %dbmhash) {
#do something with the value which is $dbmhash{$_}
}
Update:
well, i've just read your followup post and I'm still not sure what you are trying to accomplish. I see you opening the dbm file %NEWS but I don't see you trying to do anything with it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.