B-Utils
view release on metacpan or search on metacpan
t/utils/30parent.t view on Meta::CPAN
# use B::Concise;
# B::Concise::set_style(
# "#hyphseq2 (*( (x( ;)x))*)#exname-#class=(#addr) #arg ~#flags(?(/#private)?)(x(;~->#next)x)\n",
# " (*( )*) goto #seq\n",
# "(?(<#seq>)?)#exname#arg(?([#targarglife])?)"
# );
# B::Concise::compile("test_data")->();
# FIXME: Consider moving this into B::Utils. But consider warning about
# adding to B::OPS and B::Concise.
sub has_branch($)
{
my $op = shift;
return ref($op) and $$op and ($op->flags & OPf_KIDS);
}
# Set the # of tests to run and make a table of parents
my $tests = 0;
my $root = svref_2object( \&test_data )->ROOT;
walkoptree_simple( $root, sub {
my $op = shift;
( run in 1.280 second using v1.01-cache-2.11-cpan-65fba6d93b7 )