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 $NEWS
1. 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.
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.