<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
use XML::DT;
use Data::Dumper;
%handler = ( -default =&gt; sub{$c},
             person   =&gt; sub{ print " 
$c-&gt;{name} 
$c-&gt;{address}[0]

Dear $c-&gt;{name}
Merry Christmas from Morris\n"; $c;},
             -type    =&gt; { people =&gt; 'SEQ',
                           person =&gt; MMAPON('address')});

$people = dt("ex11.1.xml", %handler);

print Dumper($people);
print $people-&gt;[1]{address}[1];
</pre></body></html>