zenweezil
05-09-2003, 09:52 PM
Here's the deal.
I am opening a database grabbing matching content and trying to make the listing become one variable so I can simply use that varible elsewhere instead of the entire database query.
The problem I am running into is the variable is only grabbing the first line of the listing instead of the entire listing. Do you need a different type of varible for it to contain the entire $LIST { $listing }.
Here is what I am doing (I will skip to right where I am trying to save the listing):
$LIST{ $taglinekey } = sprintf( "%s%s%s%s",
"<li><a href=\"$link\">$headline<BR>\n" );
}
}
# Sort the found listings by price ( ascending )
foreach $listing ( sort { $b <=> $a }( keys( %LIST ) ) ) {
# Read listing into output buffer
$relatedstories = $LIST{ $listing };
}
close( DATA );
Then later in the same cgi I call the $relatedstories variable:
print DATA $relatedstories
And the result is only the first line of the listing instead of the entire listing.
Thanks in advance.
I am opening a database grabbing matching content and trying to make the listing become one variable so I can simply use that varible elsewhere instead of the entire database query.
The problem I am running into is the variable is only grabbing the first line of the listing instead of the entire listing. Do you need a different type of varible for it to contain the entire $LIST { $listing }.
Here is what I am doing (I will skip to right where I am trying to save the listing):
$LIST{ $taglinekey } = sprintf( "%s%s%s%s",
"<li><a href=\"$link\">$headline<BR>\n" );
}
}
# Sort the found listings by price ( ascending )
foreach $listing ( sort { $b <=> $a }( keys( %LIST ) ) ) {
# Read listing into output buffer
$relatedstories = $LIST{ $listing };
}
close( DATA );
Then later in the same cgi I call the $relatedstories variable:
print DATA $relatedstories
And the result is only the first line of the listing instead of the entire listing.
Thanks in advance.