It is very simple:
my $t = XML::Twig->new( twig_roots => { "IndividualRec[\@Id=\"$individual_id\"]" = +> sub { load_individual( @_, \%hash); } } ); ... sub load_individual { my( $t, $individual, $hashref)= @_; ... }
What you do here is create a closure, but you really don't have to know that! Achieving Closure has more explanations on what happens under the hood.
In reply to Re: Help with XML::Twig::Gedcom
by mirod
in thread Help with XML::Twig::Gedcom
by buttroast
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |