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.


"The dead do not recognize context" -- Kai, Lexx