- or download this
...
use Handlers::Library qw/:handlers/;
...
...
my $p = XML::Twig->new(
twig_handlers => { foo => \&foo_handler },
);
- or download this
package Handlers::Library;
my $twig_fh;
BEGIN { $twig_fh = *STDOUT; }
...
}
sub foo_handler { ... $twig->flush($twig_fh) }
sub bar_handler { ... $twig->flush($twig_fh) }
- or download this
use Handlers::Library qw/:handlers/;
twig_output('output.xml');
my $p = XML::Twig->new(...);