use strict; use XML::Rules; my $parser = XML::Rules->new( rules => [ _default => 'raw extended array']); my %plugins; %plugins = ( '_parser' => $parser, set => sub { die "The plugin requires a name attribute!\n" unless exists($_[0]->{name}); my $content = $_[0]->{_content}; $plugins{$_[0]->{name}} = sub {$content}; return; }, print => sub { print $parser->ToXML( '', process($_[0]->{_content})); return; }, select => sub { die "The This is one. This is the other. And this is yet another. This is NOT printed!