develooper Front page | perl.beginners | Postings from March 2019

Re: proper use of TEMPLATE

Thread Previous
From:
Shlomi Fish
Date:
March 14, 2019 22:03
Subject:
Re: proper use of TEMPLATE
Message ID:
20190314234005.7dafad4b@telaviv1.shlomifish.org
Hi Rick,

On Thu, 14 Mar 2019 12:14:59 -0500
Rick T <perl@reason.net> wrote:

> I’m sure this is a “newbie question,” but I am only a shade above that status
> and would appreciate some clarification.
> 
> I have
> 
> use TEMPLATE
> 

do you mean https://metacpan.org/pod/Template ?
> in my code to control whether the attribute 
> 
> selected 
> 
> appears with one of the < options> of the list following <select> in my
> served html document. Here’s one line from that list
> 
> <option value="1" [% bool_full_selected %]> Full Course (1 credit)</option>
> 
> My code can easily replace the correct var with ‘selected’ and the other vars
> on the list with a blank. But what should that blank be?
> 
> Should I make it an empty string, a space, undef, or something else? I can
> try them out to see what will work (perhaps all will work), but I want to
> know what is considered best practice and why.
> 

an empty string should be fine.

> Perhaps there’s even a whole better way to approach this! I will be grateful
> to chew over any and all comments you experienced people send me. Thanks!
> 
> Rick Triplett



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Parody of "The Fountainhead" - http://shlom.in/towtf

I’d give my right arm to be ambidextrous.
    — Source unknown via Nadav Har’El and fortune-mod

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About