FAQ

On May 14, 2004, at 10:26 AM, Ted Zlatanov wrote:
On Thu, 13 May 2004, aakhter@cisco.com wrote:

Is there a way of supressing the __VALUE__ hash that is added via a
single terminal return in <autotree>? Right now I have to play silly
little games on the return values. I realize that I could add my own
return handler but <autotree> is _so_ nice otherwise.
Why not just remove it? Untested code follows...

sub remove_VALUE
{
my $hashref = shift @_;

delete $hashref->{__VALUE__};
remove_VALUE($hashref->{$_}) foreach keys %$hashref;
}
;-) The above is possible, but why post-process the created struct when
you don't need to put in __VALUE__ at all? 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.
But perhaps my problem is not really that common...


eg:
<cpu_line(s)>
<name>DHCPD Database</name>
<0></0>
<fiveMin>0.00</fiveMin>
<fiveSec>0.00</fiveSec>
<invoked>1338361</invoked>
<oneMin>0.00</oneMin>
<pid>
<__VALUE__>112</__VALUE__>
</pid>
<runtime>32</runtime>
<tty>uSecs</tty>
<uSecs>0</uSecs>
</cpu_line(s)>

To get around this I have to do this:
$return = {
pid=>$item{num}{__VALUE__}


btw the value of interest is actually inside __VALUE__ so you'd have to
return the value of __VALUE__ and set it to the parent.
Ted
--
Aamer Akhter / aa@cisco.com
NSITE cisco Systems

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

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

2 users in discussion

Aamer Akhter: 4 posts Ted Zlatanov: 2 posts

People

Translate

site design / logo © 2018 Grokbase