Skeeve has asked for the wisdom of the Perl Monks concerning the following question:
and used this as a twig handler. I hope it's clear what I wanted to do. But I simply get the message that purge couldn't be located via XML::Twig::Elt. Can someone please tell me how to free the grand childs of my current element?sub mysub { my($t, $tag)= @_; foreach my $child ($tag->children) { # foreach my $grandchild ($tag->children) { # correction thanks to pg foreach my $grandchild ($child->children) { $grandchild->purge; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: purging of grandchildren in XML::Twig
by Zaxo (Archbishop) on Oct 19, 2003 at 04:33 UTC | |
|
Re: purging of grandchildren in XML::Twig
by pg (Canon) on Oct 19, 2003 at 06:59 UTC | |
by Skeeve (Parson) on Oct 20, 2003 at 06:36 UTC | |
|
Re: purging of grandchildren in XML::Twig
by PodMaster (Abbot) on Oct 19, 2003 at 04:44 UTC |