B-Utils1
view release on metacpan or search on metacpan
lib/B/Utils1.pm view on Meta::CPAN
package B::Utils1;
use 5.006;
use strict;
use warnings;
use vars qw( @EXPORT_OK %EXPORT_TAGS
@bad_stashes $TRACE_FH $file $line $sub $trace_removed );
use subs (
qw( all_starts all_roots anon_sub recalc_sub_cache ),
qw( walkoptree_simple walkoptree_filtered ),
qw( walkallops_simple walkallops_filtered ),
qw( opgrep op_or ),
);
sub croak (@);
sub carp (@);
use Scalar::Util qw( weaken blessed );
=head1 NAME
B::Utils1 - Helper functions for op tree manipulation
=cut
=head1 VERSION
1.05
=cut
our $VERSION = '1.05';
use base 'DynaLoader';
bootstrap B::Utils1 $VERSION;
sub dl_load_flags {0x01}
=head1 SYNOPSIS
use B::Utils1;
=cut
use B qw( OPf_KIDS main_start main_root walksymtable class main_cv ppname );
use Exporter ();
@EXPORT_OK = qw(all_starts all_roots anon_subs
walkoptree_simple walkoptree_filtered
walkallops_simple walkallops_filtered
recalc_sub_cache
opgrep op_or );
%EXPORT_TAGS = ( all => \@EXPORT_OK );
*import = \&Exporter::import;
@bad_stashes
= qw(B Carp Exporter warnings Cwd Config CORE blib strict DynaLoader vars XSLoader AutoLoader base);
use List::Util qw( shuffle );
BEGIN {
# Fake up a TRACE constant and set $TRACE_FH
BEGIN { $^W = 0 }
no warnings;
eval 'sub _TRACE () {' . ( 0 + $ENV{B_UTILS_TRACE} ) . '}';
die $@ if $@;
$TRACE_FH ||= \*STDOUT;
}
sub _TRUE () { !!1 }
sub _FALSE () { !!0 }
=head1 OP METHODS
=over 4
=cut
# The following functions have been removed because it turns out that
# this breaks stuff like B::Concise which depends on ops lacking
( run in 1.390 second using v1.01-cache-2.11-cpan-99c4e6809bf )