proper use of TEMPLATE

I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am =
only a shade above that status and would appreciate some clarification.

I have

use TEMPLATE

in my code to control whether the attribute=20

selected=20

appears with one of the < options> of the list following <select> in my =
served html document. Here=E2=80=99s one line from that list

<option value=3D"1" [% bool_full_selected %]> Full Course (1 =
credit)</option>

My code can easily replace the correct var with =E2=80=98selected=E2=80=99=
 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.

Perhaps there=E2=80=99s 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=
0
perl
3/14/2019 5:14:59 PM
perl.beginners 29336 articles. 3 followers. Follow

6 Replies
39 Views

Similar Articles

[PageSpeed] 2

Hi Rick,

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

> I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am on=
ly a shade above that status
> and would appreciate some clarification.
>=20
> I have
>=20
> use TEMPLATE
>=20

do you mean https://metacpan.org/pod/Template ?
> in my code to control whether the attribute=20
>=20
> selected=20
>=20
> appears with one of the < options> of the list following <select> in my
> served html document. Here=E2=80=99s one line from that list
>=20
> <option value=3D"1" [% bool_full_selected %]> Full Course (1 credit)</opt=
ion>
>=20
> My code can easily replace the correct var with =E2=80=98selected=E2=80=
=99 and the other vars
> on the list with a blank. But what should that blank be?
>=20
> 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.
>=20

an empty string should be fine.

> Perhaps there=E2=80=99s 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!
>=20
> Rick Triplett



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

I=E2=80=99d give my right arm to be ambidextrous.
    =E2=80=94 Source unknown via Nadav Har=E2=80=99El and fortune-mod

Please reply to list if it's a mailing list post - http://shlom.in/reply .
0
shlomif
3/14/2019 9:40:05 PM
UmljaywNCg0KQ2FuIHlvdSBpbmNsdWRlIHRoZSBhY3R1YWwgY29kZSB5b3UgYXJlIHJlZmVycmlu
ZyB0byBhcyBmcm9tIHlvdXIgbWVzc2FnZSBJIGRvIG5vdCB5ZXQgdW5kZXJzdGFuZCB3aGF0IHRo
ZSBpc3N1ZSBpcw0KDQogIER1bmNzDQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9t
OiBSaWNrIFQgW21haWx0bzpwZXJsQHJlYXNvbi5uZXRdIA0KU2VudDogMTQgTWFyY2ggMjAxOSAx
NzoxNQ0KVG86IFBlcmwgQmVnaW5uZXJzIDxiZWdpbm5lcnNAcGVybC5vcmc+DQpTdWJqZWN0OiBw
cm9wZXIgdXNlIG9mIFRFTVBMQVRFDQoNCknigJltIHN1cmUgdGhpcyBpcyBhIOKAnG5ld2JpZSBx
dWVzdGlvbizigJ0gYnV0IEkgYW0gb25seSBhIHNoYWRlIGFib3ZlIHRoYXQgc3RhdHVzIGFuZCB3
b3VsZCBhcHByZWNpYXRlIHNvbWUgY2xhcmlmaWNhdGlvbi4NCg0KSSBoYXZlDQoNCnVzZSBURU1Q
TEFURQ0KDQppbiBteSBjb2RlIHRvIGNvbnRyb2wgd2hldGhlciB0aGUgYXR0cmlidXRlIA0KDQpz
ZWxlY3RlZCANCg0KYXBwZWFycyB3aXRoIG9uZSBvZiB0aGUgPCBvcHRpb25zPiBvZiB0aGUgbGlz
dCBmb2xsb3dpbmcgPHNlbGVjdD4gaW4gbXkgc2VydmVkIGh0bWwgZG9jdW1lbnQuIEhlcmXigJlz
IG9uZSBsaW5lIGZyb20gdGhhdCBsaXN0DQoNCjxvcHRpb24gdmFsdWU9IjEiIFslIGJvb2xfZnVs
bF9zZWxlY3RlZCAlXT4gRnVsbCBDb3Vyc2UgKDEgY3JlZGl0KTwvb3B0aW9uPg0KDQpNeSBjb2Rl
IGNhbiBlYXNpbHkgcmVwbGFjZSB0aGUgY29ycmVjdCB2YXIgd2l0aCDigJhzZWxlY3RlZOKAmSBh
bmQgdGhlIG90aGVyIHZhcnMgb24gdGhlIGxpc3Qgd2l0aCBhIGJsYW5rLiBCdXQgd2hhdCBzaG91
bGQgdGhhdCBibGFuayBiZT8NCg0KU2hvdWxkIEkgbWFrZSBpdCBhbiBlbXB0eSBzdHJpbmcsIGEg
c3BhY2UsIHVuZGVmLCBvciBzb21ldGhpbmcgZWxzZT8gSSBjYW4gdHJ5IHRoZW0gb3V0IHRvIHNl
ZSB3aGF0IHdpbGwgd29yayAocGVyaGFwcyBhbGwgd2lsbCB3b3JrKSwgYnV0IEkgd2FudCB0byBr
bm93IHdoYXQgaXMgY29uc2lkZXJlZCBiZXN0IHByYWN0aWNlIGFuZCB3aHkuDQoNClBlcmhhcHMg
dGhlcmXigJlzIGV2ZW4gYSB3aG9sZSBiZXR0ZXIgd2F5IHRvIGFwcHJvYWNoIHRoaXMhIEkgd2ls
bCBiZSBncmF0ZWZ1bCB0byBjaGV3IG92ZXIgYW55IGFuZCBhbGwgY29tbWVudHMgeW91IGV4cGVy
aWVuY2VkIHBlb3BsZSBzZW5kIG1lLiBUaGFua3MhDQoNClJpY2sgVHJpcGxldHQNCi0tIA0KVG8g
dW5zdWJzY3JpYmUsIGUtbWFpbDogYmVnaW5uZXJzLXVuc3Vic2NyaWJlQHBlcmwub3JnDQpGb3Ig
YWRkaXRpb25hbCBjb21tYW5kcywgZS1tYWlsOiBiZWdpbm5lcnMtaGVscEBwZXJsLm9yZw0KaHR0
cDovL2xlYXJuLnBlcmwub3JnLw0KDQoNCg==
0
duncan
3/15/2019 9:28:35 AM
On Thu, 14 Mar 2019 12:14:59 -0500
Rick T <perl@reason.net> wrote:
> <option value=3D"1" [% bool_full_selected %]> Full Course (1
> credit)</option>
>=20
> My code can easily replace the correct var with =E2=80=98selected=E2=80=
=99 and the
> other vars on the list with a blank. But what should that blank be?
>=20
> Should I make it an empty string, a space, undef, or something else?

An empty string would work just fine.

On the other hand, your template var name there suggests it's a
boolean, indicating whether or not the full course is selected, as
opposed to containing the word "selected" or an empty string.

I'd be inclined to actually make it so, and have the "what do we output
if it *should* be selected" be in the template, e.g.:

<option value=3D"1" [% IF bool_full_selected %]selected[% END %]>....

Also, as we've not seen your full code, it's not clear how you're
generating the list of options, but you can iterate over a list or
names or hashrefs of information about each entry.

You could, for instance, have a list of hashrefs of information about
each course - the value to use in the value=3D"" attribute, the course
name to display, etc... something like:

  my %courses =3D (
    { id =3D> 1, name =3D> "Full Course", selected =3D> 1 },
    { id =3D> 2, name =3D> "Half Course", },
  );

(Of course, it's quite likely that in a production system, that
information will have been assembled from a database query or a config
file rather than hard-coded, but you get the idea.)

You could pass that on to your Template->process call, then in the
template itself, output the options with something like:

  [% FOREACH course IN courses %]
    <option value=3D"[% course.id %]"
      [% IF course.selected %]selected[% END %]>[% course.name %]
    </option>
  [% END %]


That way, your template doesn't need to know/care how many course
options there are or what they are, it only needs to know/care how to
*present* them.

Cheers

Dave P
0
davidp
3/19/2019 12:44:13 PM
--0000000000008027f105868e441e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

unsubscribe

On Thu, Mar 14, 2019 at 6:23 PM Rick T <perl@reason.net> wrote:

> I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am on=
ly a shade above that
> status and would appreciate some clarification.
>
> I have
>
> use 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=E2=80=99s one line from that list
>
> <option value=3D"1" [% bool_full_selected %]> Full Course (1 credit)</opt=
ion>
>
> My code can easily replace the correct var with =E2=80=98selected=E2=80=
=99 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 ca=
n
> try them out to see what will work (perhaps all will work), but I want to
> know what is considered best practice and why.
>
> Perhaps there=E2=80=99s 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
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>

--0000000000008027f105868e441e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">unsubscribe</div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Thu, Mar 14, 2019 at 6:23 PM Rick T &lt;<a=
 href=3D"mailto:perl@reason.net">perl@reason.net</a>&gt; wrote:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pad=
ding-left:1ex">I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=
=9D but I am only a shade above that status and would appreciate some clari=
fication.<br>
<br>
I have<br>
<br>
use TEMPLATE<br>
<br>
in my code to control whether the attribute <br>
<br>
selected <br>
<br>
appears with one of the &lt; options&gt; of the list following &lt;select&g=
t; in my served html document. Here=E2=80=99s one line from that list<br>
<br>
&lt;option value=3D&quot;1&quot; [% bool_full_selected %]&gt; Full Course (=
1 credit)&lt;/option&gt;<br>
<br>
My code can easily replace the correct var with =E2=80=98selected=E2=80=99 =
and the other vars on the list with a blank. But what should that blank be?=
<br>
<br>
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 k=
now what is considered best practice and why.<br>
<br>
Perhaps there=E2=80=99s 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!<br>
<br>
Rick Triplett<br>
-- <br>
To unsubscribe, e-mail: <a href=3D"mailto:beginners-unsubscribe@perl.org" t=
arget=3D"_blank">beginners-unsubscribe@perl.org</a><br>
For additional commands, e-mail: <a href=3D"mailto:beginners-help@perl.org"=
 target=3D"_blank">beginners-help@perl.org</a><br>
<a href=3D"http://learn.perl.org/" rel=3D"noreferrer" target=3D"_blank">htt=
p://learn.perl.org/</a><br>
<br>
<br>
</blockquote></div>

--0000000000008027f105868e441e--
0
thomasvoneyben
4/15/2019 9:27:45 AM
--0000000000003d8ee905869546bd
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> unsubscribe

To unsub (or change your settings) you need to send a msg to the listserv
admin address, not the list itself.  See:
https://lists.perl.org/list/beginners.html

You can start a subscription for an alternate address, for example
"john@host.domain", just add a hyphen and your address (with '=3D' instead =
of
'@') after the command word:
beginners-subscribe-john=3Dhost.domain@perl.org
To unsubscribe this address, mail:
beginners-unsubscribe-john=3Dhost.domain@perl.org

All subscription requests must be confirmed. You should receive a
confirmation request a few minutes after you send your request in.

On Mon, Apr 15, 2019 at 4:29 AM Thomas von Eyben <thomasvoneyben@gmail.com>
wrote:

> unsubscribe
>
> On Thu, Mar 14, 2019 at 6:23 PM Rick T <perl@reason.net> wrote:
>
>> I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am o=
nly a shade above that
>> status and would appreciate some clarification.
>>
>> I have
>>
>> use 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=E2=80=99s one line from that list
>>
>> <option value=3D"1" [% bool_full_selected %]> Full Course (1
>> credit)</option>
>>
>> My code can easily replace the correct var with =E2=80=98selected=E2=80=
=99 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 wa=
nt
>> to know what is considered best practice and why.
>>
>> Perhaps there=E2=80=99s even a whole better way to approach this! I will=
 be
>> grateful to chew over any and all comments you experienced people send m=
e.
>> Thanks!
>>
>> Rick Triplett
>> --
>> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>> For additional commands, e-mail: beginners-help@perl.org
>> http://learn.perl.org/
>>
>>
>>

--=20

a

Andy Bach,
afbach@gmail.com
608 658-1890 cell
608 261-5738 wk

--0000000000003d8ee905869546bd
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>&gt; unsubscribe</div><div><br></div=
><div>To unsub (or change your settings) you need to send a msg to the list=
serv admin address, not the list itself.=C2=A0 See:</div><div><a href=3D"ht=
tps://lists.perl.org/list/beginners.html">https://lists.perl.org/list/begin=
ners.html</a></div><div><br></div><div><p> You can start a subscription for=
 an alternate address, for
      example &quot;john@host.domain&quot;, just add a hyphen and your addr=
ess
      (with &#39;=3D&#39; instead of &#39;@&#39;) after the command word:<b=
r>
      <tt>beginners-subscribe-john=3D<a href=3D"mailto:host.domain@perl.org=
">host.domain@perl.org</a></tt><br>
      To unsubscribe this address, mail:<br>
      <tt>beginners-unsubscribe-john=3D<a href=3D"mailto:host.domain@perl.o=
rg">host.domain@perl.org</a></tt>
    </p>

    <p>All subscription requests must be confirmed.  You should
    receive a confirmation request a few minutes after you send your
    request in.</p></div></div></div><br><div class=3D"gmail_quote"><div di=
r=3D"ltr" class=3D"gmail_attr">On Mon, Apr 15, 2019 at 4:29 AM Thomas von E=
yben &lt;<a href=3D"mailto:thomasvoneyben@gmail.com">thomasvoneyben@gmail.c=
om</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
"><div dir=3D"ltr">unsubscribe</div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Thu, Mar 14, 2019 at 6:23 PM Rick T &lt;<a=
 href=3D"mailto:perl@reason.net" target=3D"_blank">perl@reason.net</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I=E2=80=
=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am only a shad=
e above that status and would appreciate some clarification.<br>
<br>
I have<br>
<br>
use TEMPLATE<br>
<br>
in my code to control whether the attribute <br>
<br>
selected <br>
<br>
appears with one of the &lt; options&gt; of the list following &lt;select&g=
t; in my served html document. Here=E2=80=99s one line from that list<br>
<br>
&lt;option value=3D&quot;1&quot; [% bool_full_selected %]&gt; Full Course (=
1 credit)&lt;/option&gt;<br>
<br>
My code can easily replace the correct var with =E2=80=98selected=E2=80=99 =
and the other vars on the list with a blank. But what should that blank be?=
<br>
<br>
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 k=
now what is considered best practice and why.<br>
<br>
Perhaps there=E2=80=99s 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!<br>
<br>
Rick Triplett<br>
-- <br>
To unsubscribe, e-mail: <a href=3D"mailto:beginners-unsubscribe@perl.org" t=
arget=3D"_blank">beginners-unsubscribe@perl.org</a><br>
For additional commands, e-mail: <a href=3D"mailto:beginners-help@perl.org"=
 target=3D"_blank">beginners-help@perl.org</a><br>
<a href=3D"http://learn.perl.org/" rel=3D"noreferrer" target=3D"_blank">htt=
p://learn.perl.org/</a><br>
<br>
<br>
</blockquote></div>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature"><br>a<br><br>Andy Bach,<br><a href=3D"mailto:afbach@gmail.c=
om" target=3D"_blank">afbach@gmail.com</a><br>608 658-1890 cell<br>608 261-=
5738 wk</div>

--0000000000003d8ee905869546bd--
0
afbach
4/15/2019 5:49:18 PM
--Apple-Mail-35BBB0E0-D1A3-4F45-8696-3E37F2275915
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

Lazy. =20

(Sent from iPhone, so please accept my apologies in advance for any spelling=
 or grammatical errors.)

> On Apr 15, 2019, at 12:49 PM, Andy Bach <afbach@gmail.com> wrote:
>=20
> > unsubscribe
>=20
> To unsub (or change your settings) you need to send a msg to the listserv a=
dmin address, not the list itself.  See:
> https://lists.perl.org/list/beginners.html
>=20
> You can start a subscription for an alternate address, for example "john@h=
ost.domain", just add a hyphen and your address (with '=3D' instead of '@') a=
fter the command word:
> beginners-subscribe-john=3Dhost.domain@perl.org
> To unsubscribe this address, mail:
> beginners-unsubscribe-john=3Dhost.domain@perl.org
>=20
> All subscription requests must be confirmed. You should receive a confirma=
tion request a few minutes after you send your request in.
>=20
>=20
>> On Mon, Apr 15, 2019 at 4:29 AM Thomas von Eyben <thomasvoneyben@gmail.co=
m> wrote:
>> unsubscribe
>>=20
>>> On Thu, Mar 14, 2019 at 6:23 PM Rick T <perl@reason.net> wrote:
>>> I=E2=80=99m sure this is a =E2=80=9Cnewbie question,=E2=80=9D but I am o=
nly a shade above that status and would appreciate some clarification.
>>>=20
>>> I have
>>>=20
>>> use TEMPLATE
>>>=20
>>> in my code to control whether the attribute=20
>>>=20
>>> selected=20
>>>=20
>>> appears with one of the < options> of the list following <select> in my s=
erved html document. Here=E2=80=99s one line from that list
>>>=20
>>> <option value=3D"1" [% bool_full_selected %]> Full Course (1 credit)</op=
tion>
>>>=20
>>> My code can easily replace the correct var with =E2=80=98selected=E2=80=99=
 and the other vars on the list with a blank. But what should that blank be?=

>>>=20
>>> Should I make it an empty string, a space, undef, or something else? I c=
an try them out to see what will work (perhaps all will work), but I want to=
 know what is considered best practice and why.
>>>=20
>>> Perhaps there=E2=80=99s even a whole better way to approach this! I will=
 be grateful to chew over any and all comments you experienced people send m=
e. Thanks!
>>>=20
>>> Rick Triplett
>>> --=20
>>> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>>> For additional commands, e-mail: beginners-help@perl.org
>>> http://learn.perl.org/
>>>=20
>>>=20
>=20
>=20
> --=20
>=20
> a
>=20
> Andy Bach,
> afbach@gmail.com
> 608 658-1890 cell
> 608 261-5738 wk

--Apple-Mail-35BBB0E0-D1A3-4F45-8696-3E37F2275915
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto">Lazy. &nbsp;<br><br><div id=3D"AppleMailSig=
nature" dir=3D"ltr"><span style=3D"background-color: rgba(255, 255, 255, 0);=
">(Sent from iPhone, so please accept my apologies in advance for any spelli=
ng or grammatical errors.)</span></div><div dir=3D"ltr"><br>On Apr 15, 2019,=
 at 12:49 PM, Andy Bach &lt;<a href=3D"mailto:afbach@gmail.com">afbach@gmail=
..com</a>&gt; wrote:<br><br></div><blockquote type=3D"cite"><div dir=3D"ltr">=
<div dir=3D"ltr"><div dir=3D"ltr"><div>&gt; unsubscribe</div><div><br></div>=
<div>To unsub (or change your settings) you need to send a msg to the listse=
rv admin address, not the list itself.&nbsp; See:</div><div><a href=3D"https=
://lists.perl.org/list/beginners.html">https://lists.perl.org/list/beginners=
..html</a></div><div><br></div><div><p> You can start a subscription for an a=
lternate address, for
      example "<a href=3D"mailto:john@host.domain">john@host.domain</a>", ju=
st add a hyphen and your address
      (with '=3D' instead of '@') after the command word:<br>
      <tt>beginners-subscribe-john=3D<a href=3D"mailto:host.domain@perl.org"=
>host.domain@perl.org</a></tt><br>
      To unsubscribe this address, mail:<br>
      <tt>beginners-unsubscribe-john=3D<a href=3D"mailto:host.domain@perl.or=
g">host.domain@perl.org</a></tt>
    </p>

    <p>All subscription requests must be confirmed.  You should
    receive a confirmation request a few minutes after you send your
    request in.</p></div></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Mon, Apr 15, 2019 at 4:29 AM Thomas von Eyb=
en &lt;<a href=3D"mailto:thomasvoneyben@gmail.com">thomasvoneyben@gmail.com<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr">unsubscribe</div><br><div class=3D"gmail_quote"><div dir=3D"lt=
r" class=3D"gmail_attr">On Thu, Mar 14, 2019 at 6:23 PM Rick T &lt;<a href=3D=
"mailto:perl@reason.net" target=3D"_blank">perl@reason.net</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex">I=E2=80=99m sure thi=
s is a =E2=80=9Cnewbie question,=E2=80=9D but I am only a shade above that s=
tatus and would appreciate some clarification.<br>
<br>
I have<br>
<br>
use TEMPLATE<br>
<br>
in my code to control whether the attribute <br>
<br>
selected <br>
<br>
appears with one of the &lt; options&gt; of the list following &lt;select&gt=
; in my served html document. Here=E2=80=99s one line from that list<br>
<br>
&lt;option value=3D"1" [% bool_full_selected %]&gt; Full Course (1 credit)&l=
t;/option&gt;<br>
<br>
My code can easily replace the correct var with =E2=80=98selected=E2=80=99 a=
nd the other vars on the list with a blank. But what should that blank be?<b=
r>
<br>
Should I make it an empty string, a space, undef, or something else? I can t=
ry them out to see what will work (perhaps all will work), but I want to kno=
w what is considered best practice and why.<br>
<br>
Perhaps there=E2=80=99s even a whole better way to approach this! I will be g=
rateful to chew over any and all comments you experienced people send me. Th=
anks!<br>
<br>
Rick Triplett<br>
-- <br>
To unsubscribe, e-mail: <a href=3D"mailto:beginners-unsubscribe@perl.org" ta=
rget=3D"_blank">beginners-unsubscribe@perl.org</a><br>
For additional commands, e-mail: <a href=3D"mailto:beginners-help@perl.org" t=
arget=3D"_blank">beginners-help@perl.org</a><br>
<a href=3D"http://learn.perl.org/" rel=3D"noreferrer" target=3D"_blank">http=
://learn.perl.org/</a><br>
<br>
<br>
</blockquote></div>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"gm=
ail_signature"><br>a<br><br>Andy Bach,<br><a href=3D"mailto:afbach@gmail.com=
" target=3D"_blank">afbach@gmail.com</a><br>608 658-1890 cell<br>608 261-573=
8 wk</div>
</div></blockquote></body></html>=

--Apple-Mail-35BBB0E0-D1A3-4F45-8696-3E37F2275915--
0
hal
4/15/2019 5:58:09 PM
Reply: