Help for this page

Select Code to Download


  1. or download this
    ...
    use Handlers::Library qw/:handlers/;
    ...
    ...
    my $p = XML::Twig->new(
        twig_handlers => { foo => \&foo_handler },
    );
    
  2. 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) }
    
  3. or download this
    use Handlers::Library qw/:handlers/;
    twig_output('output.xml');
    my $p = XML::Twig->new(...);