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.




------------------------------------------------------- This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/ _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to