Jordan, Anthony ([EMAIL PROTECTED]) said something to this effect on 06/04/2001:
> I'd be grateful if someone could point out where I'm going wrong.
>
> Perl version 5.6.1 (Activestate) and Template downloaded and installed today
> (2.02).

bash$ perl -Mstrict -MTemplate
my $templatetext = << 'EOT';
[% dayofweek = 'monday' %]
[% mylist.fred.gender = 'male' %]
[% mylist.susi.gender = 'female' %]
[% FOREACH firstname = mylist.keys %]
[% SWITCH dayofweek %]
[% CASE 'monday' %]
It is monday
[% firstname %] is [% mylist.$firstname.gender %]
[% NEXT IF mylist.$firstname.gender != 'male' %]
Monday stuff here for males
[% CASE DEFAULT %]
[% firstname %] is [% mylist.$firstname.gender %]
Other day of the week stuff here
[% END %]
End of switch statement
[% END %]

EOT

my $t = Template->new;
$t->process(\$templatetext) or die $t->error;
^D

Give me:
It is monday
susi is female

End of switch statement

# End
So, it works for me.

bash$ perl -v
This is perl, v5.6.0 built for i686-linux

bash$ perl -MTemplate -le 'print Template->VERSION'
2.00

Might this be a Template 2.02 thing?

(darren)

--
How can I believe in God when just last week I got my tongue caught
in the roller of an electric typewriter?
    -- Woody Allen


Reply via email to