Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 24925
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: GHENRY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.18
Fixed in: (no value)



Subject: SWITCH and CASE Syntax in Docs/Pod
Hi, When testing my var like so (in 2.15, but the docs are the same in 2.18, so reporting against that): [% SWITCH page %] [% CASE subscribe %] [% INCLUDE base/menus/subscribe.tt %] [% CASE messages %] [% INCLUDE base/menus/messages.tt %] [% CASE edituser %] [% PROCESS base/menus/edituser.tt %] [% CASE DEFAULT %] Testing default. Page is: [% page %] [% END %] This doesn't work unless you change the CASE to quote the value, e.g. [% CASE 'subscribe' %] The docs/pod just show: [% CASE val1 %] If I am incorrect, apologies, but if the docs need a patch, just say so. t/switch.t seems to have both syntaxes as well, so not sure. Thanks, Gavin.
Show quoted text
> If I am incorrect, apologies, but if the docs need a patch,
You need to quote literal values or not quote values stored in variables. I've updated the docs to make this clearer.