in reply to Nice HTML::Template feature

$t->param( "hallo" => \&littletest );

That is more or less equal to:

print "1 " . time() . "\n"; $t->param( "hallo" => "test" );
Which explains why the "1" is printed before the "2".

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Nice HTML::Template feature
by mce (Curate) on Apr 18, 2002 at 10:57 UTC
    Hi,<pb> please note that 1 is printed before 2 in case of:
    $t->param( "hallo" => &littletest );
    And this is what one expects because it runs the sub before calling param.

    Or am I wrong??
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium

      And this is what one expects because it runs the sub before calling param.

      Right. How can that be one of HTML::Template's feature? When you call a sub, the returned value is used, so it reads "hallo" => "test", but just before "test" is returned, the "1" with timestamp is printed.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.