in reply to How do I delete a specific element from an XML file
That's what supposed to happen. If you do a Data::Dumper of $category, you will see that $category->{'subcategory'}[$countersubs]{'product'}[$counterprod]{'channel'} is a hash element that contains an array ref.
delete $category->{'subcategory'}[$countersubs]{'product'}[$counterpro +d]{'channel'}[counterchan]
deletes the counterchan th element of the array. (I think "counterchan" is a typo of "$counterchan")
delete $category->{'subcategory'}[$countersubs]{'product'}[$counterpro +d]{'channel'}
deletes the hash element, which is the entire array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I delete a specific element from an XML file
by pg (Canon) on Oct 31, 2004 at 03:50 UTC | |
by Maxim (Sexton) on Oct 31, 2004 at 05:18 UTC | |
by Maxim (Sexton) on Nov 02, 2004 at 04:02 UTC | |
by Maxim (Sexton) on Nov 02, 2004 at 06:45 UTC |