On May 15, 2004, at 9:32 PM, Ted Zlatanov wrote:
On Fri, 14 May 2004, [EMAIL PROTECTED] 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:
$::RD_AUTOACTION = q{ 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} = [EMAIL PROTECTED]; 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
Ted
-- Aamer Akhter / [EMAIL PROTECTED] NSITE cisco Systems