Hello

Below is a  portion of a script that displays a table. The argument
passed by param() determines the number of rows the table should
display. 
For some unknown reason, the value of param() seem to behave strangely.
It at times the value does not change; even if a different number is
sent as an argument to the script.  What is wrong in the conditional
statement or param(). I tried "my $value_of_param " and "use vars
qw($value_of_param)"  but the value remains unpredictable.  

Thanks for any help


#####################################################

@links = (1..$pages) if $pages;
foreach $link (@links){
            
print qq(<a href='?action=$link'>&nbsp; [$link] &nbsp;</a>); # Clicking
the link sends the value to this script as parameter.
}
   
#my $value_of_param;
use vars qw($value_of_param);

if ($obj->param('action')){
      $value_of_param = $obj->param('action');
         if ($value_of_param == 1){
            
            $sql = "$query LIMIT 0, $max_rows";        
         }
         elsif ($value_of_param == 2){
            $sql = "$query LIMIT 51, $max_rows";
       }
       else {
          $start_po += ((50 * $value_of_param) + 1);
          $sql = "$query LIMIT $start_po, $max_rows";
       }

   }
   else {
      $sql = "$query LIMIT $start_po, $max_rows";
   }

# See value of  param() :
print qq($value_of_param) if ($value_of_param);






Reply via email to