Gossamer Forum
Home : General : Perl Programming :

$count++

Quote Reply
$count++
Hello, I have a script that searches a mysql database, in the routine that dumps the results I have placed
$count++;

If I put into the same sub that dumps the results, $count it shows a number next to the record indicating that that is result #1.

Now I have another sub that places a header on the top of the search results, I have placed $count in it, but it does not print the number. Is this because it's in a different sub routine than the $count++ or something totaly different.

What Im trying to achieve is a way of showing the total amount of records that matched what the user was looking for and displaying it in the header.

Is there an easy way of doing this?

Thank you for your time and patience
Harrison


"I've got if's pretty good, but that's about it"
Quote Reply
Re: $count++ In reply to
You have to pass $count as a paramater to the subroutine you're calling (unless $count is a global variable)

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.