I've been trying to write a plugin to use IO::File functions, and come up with 
the following skeleton code:

package Template::Plugin::IO::File;

require 5.004;

use strict;
use Template::Plugin;
use vars qw( @ISA $VERSION );
# use base qw( Template::Plugin );

@ISA     = qw( Template::Plugin );
$VERSION = 0.01;

use IO::File;

sub new {
    my ( $class, $context, @args ) = @_;
    return IO::File->new(@args);

}

1;

I can use it in templates:

[% USE fh = IO.File %]

[% fh.open(">> c:/test.txt") %]

[% fh.print("my new line here\n") %]

[% fh.close %]

But when I view the (HTML) page, I get '1's returned in the source. I can 
suppress this output using CALL:

[% CALL fh.print("my new line here\n") %]

But, well, I'm lazy I want to be able to do that by default. How can I suppress 
that '1' reponse an the Plugin level?

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

Reply via email to