After quite a bit of poking around in the script, I actually got it to work, well 99.9% anyway.

$t->number_in( $number_in );

Going by some other pages I have, I understood the above line to mean that ->number_in will be replaced by the value in $number_in. However, when the page hits the browser, what was __number_in__ in the template is now empty.
Instead of <title>__number_in__</title> becoming <title>6</title>
it is becoming <title></title>

I know that my code is a mess, but it works. (with 1 exception ofcourse)

#! c:\perl\bin\perl.exe -T
use warnings;
#use strict;


use CGI qw/:all/;

use CGI::Carp qw/fatalsToBrowser/;

use HTMLTMPL;

my $t = HTMLTMPL->new();

{

$number_in = 6;

  $string1 = abcdef;
  $string2 = ghijkl;
  $string3 = mnopqr;
  $string4 = stuvwx;


  $number_out = $number_in;

  while ($number_out > 24) {$number_out -= 24;}

  if (($number_out > 0) && ($number_out <= 6)) {$string = $string1;}
if (($number_out > 6) && ($number_out <= 12)) {$number_out -= 6;$string = $string2;} if (($number_out > 12) && ($number_out <= 18)) {$number_out -= 12;$string = $string3;} if (($number_out > 18) && ($number_out <= 24)) {$number_out -= 18;$string = $string4;}


$ZZZZ = substr $string, $number_out-1, 1;

}

$t->src( "c:/apache2/htdocs/testing/testing123/$ZZZZ.html" );
$t->number_in( $number_in );      # <----- not doing it properly

$t->output( CGI::header );

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to