Thanks. However I still can't seem to figure out how to
pass the
category to the keyword template.
Hope I'm not asking to much...
Thanks
On 9/20/06, David E. Wheeler <david kineticode.com> wrote:
> On Sep 19, 2006, at 19:15, Chauncey Thorn wrote:
>
> > Has anyone done this? Will the above work?
>
> No, Perl does not have a switch statement. But
if/elsif/else should
> work:
>
> if ($value eq '/category1/') {
> my keywords = 'keyword1,keyword2,etc';
> } elsif ($value eq '/category2/') {
> my keywords = 'keyword1,keyword2,etc';
> } else {
> # ...
> }
>
> If you want something switch-like, try using the
trinary operator:
>
> my keywords = $value eq '/category1/' ? qw(foo bar)
> : $value eq '/category2/' ? qw(baz
boo)
> :
$m->comp(...);
>
> Best,
>
> David
>
|