in reply to call tree analysis using perl
Given how fragile and experimental Devel::Calltree is reported to be, and assuming that your data isn't any more complex than what you're showing (large assumption, I know), you could try unwrapping them yourself.
#!/usr/bin/perl -w use warnings; use strict; my ($tag, %list); while (<DATA>){ next unless /./; if (/^(\w+)/){ $tag = $1; next; } if (/^-- (\w+)/){ push @{$list{$tag}}, $1; } } for my $type (@{$list{main}}){ if ($list{$type}){ for (@{$list{$type}}){ print "main $type $_\n"; } } else { print "main $type\n"; } } __END__ display -- audit -- bass elucent -- audit -- check main -- display -- elucent -- audit -- check
Output:
main display audit main display bass main elucent audit main elucent check main audit main check
-- I hate storms, but calms undermine my spirits. -- Bernard Moitessier, "The Long Way"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: call tree analysis using perl
by rajkrishna89 (Acolyte) on Feb 15, 2012 at 16:18 UTC | |
Re^2: call tree analysis using perl
by Anonymous Monk on Feb 15, 2012 at 08:49 UTC | |
by Eliya (Vicar) on Feb 15, 2012 at 09:03 UTC | |
by stallion (Acolyte) on Feb 15, 2012 at 11:30 UTC | |
by Eliya (Vicar) on Feb 15, 2012 at 11:37 UTC |
In Section
Seekers of Perl Wisdom