nico38100 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Guys, I have a question on a twig module. Do you know the way to build the twig_handler with variables, I show you below what I would like to do
If you have any idea to do this . Many Thanks Nicolasmy $test = sub { $_->delete()}; my $node_to_delete = 'node1-node2-node3-node4'; my @tags = split('-', $node_to_delete ); // my objective with a foreach will be to get a varaible // my $handlers = {$tags[0] => $test, $tags[1] => $test ) my $twig = new XML::Twig( twig_handlers => { $twig_handlers,}); $twig->parsefile(*DATA);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: TWig handler generation
by holli (Abbot) on Feb 01, 2019 at 15:02 UTC | |
by nico38100 (Novice) on Feb 01, 2019 at 16:52 UTC | |
by holli (Abbot) on Feb 01, 2019 at 17:01 UTC | |
|
Re: TWig handler generation -- dispatch table
by Discipulus (Canon) on Feb 01, 2019 at 17:04 UTC | |
by nico38100 (Novice) on Feb 01, 2019 at 17:21 UTC | |
by poj (Abbot) on Feb 01, 2019 at 19:41 UTC | |
by nico38100 (Novice) on Feb 05, 2019 at 09:49 UTC |