[htmltmpl] h::t on different platforms
Brought to you by:
samtregar
From: Puneet K. <pk...@ei...> - 2003-10-27 17:36:09
|
The following works fine on both MacOS X (Perl 5.6.0) and Windows XP (Perl 5.8.0). my $f = sub { my $t = shift; $$t =~ s/<!--#.*?-->//g; }; my $template = HTML::Template->new( filename => index.tmpl, global_vars => 1, loop_context_vars => 1, filter => $f ); However, the following works fine on MacOS X my $template = HTML::Template->new( filename => index.tmpl, global_vars => 1, loop_context_vars => 1, filter => sub { $$ =~ s/<!--#.*?-->//g; } ); but gives the following error on Windows XP HTML::Template->new() : fatal error occured during filter call: Modification of a read-only value attempted at D:/htdocs/perlpim/cal/index.cgi line 28. at D:/htdocs/perlpim/cal/index.cgi line 29 Line 29 is filter => sub { $$ =~ s/<!--#.*?-->//g; } what gives? Thanks. |