#!/usr/bin/perl -w # use strict; use Data::Dumper; use Xml; my $ret; my $tst = Xml -> new ( \*STDIN ); $tst -> set( 'TOLERATE', 'BETWEEN', 'TAGS', '-', 1 ); # allow '-' between tags a new requirement $tst -> set( 'DEPTH', 2 ); # return tags at depth 2 ignoring depth one envelope to avoid huge hash $tst -> set( 'CALLBACK', 'ALL', sub { print Dumper @_; } ); # but now we needed e.g. callbacks which have just been facilitated in the Xml module do { $ret = $tst -> get( 'TAG' ); } while $ret;