Re: Neato Tricks That Aren't Documented Anywhere

Warren Smith <wsmith-KfBRzk3UKwrYd54FQh9/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
This reminds me. There's a small bug in the Decode.pm. It needs to have
return undef; as the last line of process. Then you can use it in
petal:attribute statements:

Given {
	myselect => 2,
	options => [
		{ value => 1, label => 'Bob' },
		{ value => 2, label => 'Joe' },
		{ value => 3, label => 'Connor' }
	],
}
	
<select>
  <option petal:repeat="option options" petal:attributes="selected
decode: option myselect 1">
</select>

and the proper value for this select option will have the selected
attribute.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.