Ok I'm totally stuck on handling multiple pages, and this is all i need to finish my sub showmain that does the shopping mall main index.
I have $page var and $totpages var that tell me current page number to display and the total pages in the index.
plus I have a $shopcolcnt var for the number of shops per column. then I get to follow bit that parses the datafile
# one datafile how da heck to split it into pages
@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/shops/shoplist.cgi");
foreach $thisline(@datafile) {
chomp($thisline);
if ($thisline ne '') {
@linearray = split(/\|\|/,$thisline);
##output it if active shop
if ($linearray[6]=1) {
## weed out shop type for each column
if ($linearray[1] == "0") {
# we have a pit shop
$pshops .= "<br><b><a href=\"$linearray[3]\">$linearray[2]</a></b><br>\n";
$pshops .= "<br><a href=\"$linearray[3]\"><img src=\"http://dragboatalley.com/shops/$linearray[4]\" border=\"1\" alt=\"Click Here to visit this Shop\"</a><br><br><br>\n";
} else {
# we have a featured shop
$fshops .= "<br><b><a target=\"_blank\" href=\"$linearray[3]\">$linearray[2]</a></b><br>\n";
$fshops .= "<br><a target=\"_blank\" href=\"$linearray[3]\"><img src=\"http://dragboatalley.com/shops/$linearray[4]\" border=\"1\" alt=\"Click Here to visit this Shop\"</a><br><br><br>\n";
}
}
}
}
as-is, it dumps all shops on one page not matter what page requested. The only thing i did with the page handling vars was page number links at bottom of index.