in reply to Chronologically sort a DBM DB into an array?

It probably would be much more helpful to yourself, if you spend some effort first to have some draft. Then everyone here can help you to enhance it.

Have read your home node Spidy. You are only 15, and is now a monk, wow!

  • Comment on Re: Chronologically sort a DBM DB into an array?

Replies are listed 'Best First'.
Re^2: Chronologically sort a DBM DB into an array?
by Spidy (Chaplain) on Oct 06, 2004 at 02:33 UTC
    Well, so far all I've got is this...


    use CGI qw(:standard); dbmopen(my %NEWS, "news", 0644) #opening the db or die("Error opening news database: $!"); open(TEMPLATE,"newstemp.html"); #opening the template while(<TEMPLATE>) { #reading it in $temp .= $_; } close TEMPLATE;



    And then later on...

    $temp =~ s/\[\%1\%\]/$news1/; $temp =~ s/\[\%2\%\]/$news2/; print header(); print "$temp";


    However, I don't know exactly how I'm supposed to get the entries from the DBM into the array. After that, it's just a simple matter of setting $news1 to $NEWS[0], and $news2 to $NEWS1. I've encountered a stumbling point with the array and sorting though, and have no idea exactly how to do it.




    and on the age thing, thanks. It took lots of hard work, and more spare time than should be legally possible.