Josh803316 wrote:
> I'm trying to execute some perl code inside my brackets with the 
> eval_perl filter. 
> 
> [% $self->{$transport}->begin_privileged($params->{enable_password}); | 
> perl %]
> 
> I get the following error message:
> 
> file error - parse error - input text line 1: unexpected token (>)
> 
> I assume this is because of the -> arrow method calls.  Do I have to 
> escape those somehow?  What is the proper syntax to use inside the perl 
> block

You need to use a string if you are going to use a filter. Like this:
[% '$self->{$transport}->begin_privileged($params->{enable_password});' | perl 
%]

or:
[% PERL %]
code.
[% END %]

However, I don't think this is doing what you think it is going to do. The perl 
is just being eval'd here and you probably won't have access to all those 
variables. You might be better off passing a sub in via the vars hash passed to 
the TT process method. The sub can do the necessary work you need then.

-- Josh

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

Reply via email to