Hello,
 
    I was wondering if any of you could be so kind and assist me with this vexing issue. I have a HUGE directory of pictures that are numbered 1,2,3,4,5,6, etc, etc.. I have divided this directory into subdirecotry sets of 100. I'm needing to determine which set we are in via the current image number. I would do this processing before calling the template, but, either I don't know how or it's not possible. So, I was looking through the manual and found you can all subs and get return values, my issue now is, I can get a value returned, but, I can't get the value I want passed. I need to pass the picture number from the template itself because each template can contain more than one sets worth of pictures, here is my example/non-working code: Any help is appreciated.
 
An example image call in the template:
 <img src="" border="1">
 
And my $vars has this in it:
 "set" => get_set()
 
The get_set routine:
 
sub get_set {
########################################
## Determine the set we are in
########################################
 
   my $pic = $_[0];
   my $set;
 
   if ($pic >= 1000) {
 
        $set = substr($pic,0,2) . "00";
 
   } elsif ($pic <= 1000 && $pic >= 100)  {
 
        $set = substr($pic,0,1) . "00";
 
   } else {
 
        $set = "0";
 
   }
 
   return $set;
 
}
 
Thanks,
Wassim

Reply via email to