On May 15, 2004, at 9:32 PM, Ted Zlatanov wrote:
On Fri, 14 May 2004, aakhter@cisco.com wrote:

;-) The above is possible, but why post-process the created struct
when you don't need to put in __VALUE__ at all?
Because <autotree> is a generic feature, and you're asking for
something very specific. At least that's my view of it.
I agree. I was able to get what I wanted via this:

if ($#item==1 && ($item->isterminal || ref $item[1] ne 'ARRAY')) {
$return = $item[1];
} else {
foreach my $i (keys %item) {
if ($i=~ s/(\([\?s]\))$//o) {
$item{$i} = \@{$item{$i.$1}};
delete $item{$i.$1};
$return = bless \%item, $item[0];

which also cleans up the (s) and (?) return names, so I'm happy. It's
great that prd was do well designed to be customizable. Hopefully,
$item->isterminal is something that'll stick around for a while.
It's humbling to see the XML::Simple options, for instance, that have
to deal with collapsing key-value pairs. Do you really want
<autotree> to be something that complex?
I understand the need for it for some applications. But other ones
(eg when converting the returned hash to xml via xml::simple) only
add a level of unneeded indirection.
Speaking of the devil :) lol
Aamer Akhter / aa@cisco.com
NSITE cisco Systems

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 6 | next ›
Discussion Overview
grouprecdescent @
postedMay 14, '04 at 3:37a
activeMay 15, '04 at 1:39p

2 users in discussion

Aamer Akhter: 4 posts Ted Zlatanov: 2 posts



site design / logo © 2019 Grokbase