in reply to Re: Re: HTML::Template question - tmpl_if
in thread HTML::Template question - tmpl_if
Well this is somewhat poor style, but you could say something like:
options => defined($hashref->{'options'}) || []
How about a nice map though that only pulls out the defined elements in your hash?
map { defined $hash->{$_} ? ($_ => $hash->{$_}) : () } keys %$hash;
The output then can be fed directly into param. This is limited too in that it assumes your hashkeys are identical to your fields (TMPL_VARS), but if you can live with that assumption it might work for you.
HTH
"The dead do not recognize context" -- Kai, Lexx
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: HTML::Template question - tmpl_if
by kiat (Vicar) on Dec 14, 2003 at 02:27 UTC | |
by djantzen (Priest) on Dec 14, 2003 at 02:50 UTC | |
by kiat (Vicar) on Dec 14, 2003 at 04:23 UTC |
In Section
Seekers of Perl Wisdom