bazz
01-17-2006, 08:02 PM
Hi,
My foreach loop outputs more than ten items. I want to place about 10 items on each page with a row of hyperlinks page2 page 3 etc. The as you click each hyperlink, the script could re-run outputting the data as appropriate. How should I try to go about this please?
I think I can see hashes as the solution but I'm not sure and, still, have a mental block with them. :(
foreach (sort @listOfDirs ) {
if ($distance <= $radius) {
# /// end showing radius /// #
# /// output the html /// #
$baseBusinessName1st =~ s/-/ /g;
$rounded = sprintf("%.2f", $distance);
$nearbyBusinesscompiler = join('_', $nearbyBusinessName,$nearbyBusinessType,$nearbyBusinessSubType, $nearbyBusinessCat,$nearbyBusinessLocalRegion,$nearbyBusinessCounty,$nearbyBusinessGrid, $nearbyBusinessPostCode,$nearbyBusinessGroupName);
$nearbyBusinessName =~ s/-/ /g;
$nearbyBusinessCat =~ s/-/ /g;
$baseBusinessName =~ s/-/ /g;
unless ( $category eq $nearbyBusinessType && $subCategory eq $nearbyBusinessSubType ) {
# do nothing
} else {
print <<EOF;
<dt>$nearbyBusinessName</a></dt>
<dd>Distance: $rounded Km $NorthSouth$WestEast of $baseBusinessName</dd>
<dd>Classification: $nearbyBusinessCat</dd>
EOF
}
Any tips appreciated
Bazz
My foreach loop outputs more than ten items. I want to place about 10 items on each page with a row of hyperlinks page2 page 3 etc. The as you click each hyperlink, the script could re-run outputting the data as appropriate. How should I try to go about this please?
I think I can see hashes as the solution but I'm not sure and, still, have a mental block with them. :(
foreach (sort @listOfDirs ) {
if ($distance <= $radius) {
# /// end showing radius /// #
# /// output the html /// #
$baseBusinessName1st =~ s/-/ /g;
$rounded = sprintf("%.2f", $distance);
$nearbyBusinesscompiler = join('_', $nearbyBusinessName,$nearbyBusinessType,$nearbyBusinessSubType, $nearbyBusinessCat,$nearbyBusinessLocalRegion,$nearbyBusinessCounty,$nearbyBusinessGrid, $nearbyBusinessPostCode,$nearbyBusinessGroupName);
$nearbyBusinessName =~ s/-/ /g;
$nearbyBusinessCat =~ s/-/ /g;
$baseBusinessName =~ s/-/ /g;
unless ( $category eq $nearbyBusinessType && $subCategory eq $nearbyBusinessSubType ) {
# do nothing
} else {
print <<EOF;
<dt>$nearbyBusinessName</a></dt>
<dd>Distance: $rounded Km $NorthSouth$WestEast of $baseBusinessName</dd>
<dd>Classification: $nearbyBusinessCat</dd>
EOF
}
Any tips appreciated
Bazz