Is there a special way to pass undef to a method from
within a template? Does saying [% obj.method(undef) %]
somehow pass an empty string as an the arguemnt?

Why i ask is i'm getting different results from
"equivalent" code when its done in perl and when its
done inside the template.

Here's code in template and perl. in both cases, opt
is   a HTML::Element "option" object.
[%
    FOR opt IN element.content_list;
        opt.attr('selected', undef)
            IF opt.attr('selected');
    END;
    # Doesn't WORK. makes opt have selected="" 
%]

# in perl module method
     foreach my $opt ($cgi{$field}->content_list) {
       $opt->attr('selected', undef)
           if $opt->attr('selected');
     }
     # works , selected attribute is deleted entirely
     # as HTML::Element manual says should happen


thanks




                
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to