#!/usr/bin/perl -- use strict; use warnings; use XML::Rules; my $xml = q~ this is the text I would like to parse more text interesting text ~; my $parser = XML::Rules->new( stripspaces => 7, rules => { entry => sub { my ($tag, $atts) = @_; print $atts->{_content},"\n"; return; }, }, ); $parser->parse($xml); __END__ this is the text I would like to parse more text