The <% %> is only the way to display the variable in the template. It's not a variable or global in and of itself.
In the code itself you need to declare the variables. I think you need to take a step or two backwards, out of the template routines. All this needs to be in the search.cgi script. Initialize it when you start, subtract it out when you end, and stuff it into $rec-> (or even $IN->) to return the value to the template.
Whatever you stuff into the hash sent to the template routine will turn into the tag.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ
In the code itself you need to declare the variables. I think you need to take a step or two backwards, out of the template routines. All this needs to be in the search.cgi script. Initialize it when you start, subtract it out when you end, and stuff it into $rec-> (or even $IN->) to return the value to the template.
Whatever you stuff into the hash sent to the template routine will turn into the tag.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ