| 1 | package B::FindAmpersand; | ||||||||||
| 2 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.2
| |||||||||||
| 3 | 1 | require Config; | |||||||||
| 4 | 1 | ▶ | die "B::FindAmpersand not supported for threaded perl" if $Config::Config{usethreads}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 5 | } | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use B; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | $VERSION = "0.04"; | |||||||||
| 12 | |||||||||||
| 13 | 1 | my $evil = join "", qw"[ ` & ' ]"; | |||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | sub compile { | ||||||||
|
Subroutine
compile: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 1 | ▶ | return sub { B::walkoptree(B::main_root(), "findampersand") } | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 1 | } | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub B::GVOP::findampersand { | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 0 | my($op, $level) = @_; | |||||||||
| 21 | 0 | $op->gv->findampersand($op); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 4 | ▶ | sub B::GV::findampersand { | ||||||||
|
Subroutine
findampersand: called CC=2 SCAR=6.9
| |||||||||||
| 25 | 4 | my($gv) = @_; | |||||||||
| 26 | 4 | ▶ | return unless $gv->NAME =~ /^$evil$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 1 | my @report = ($gv->NAME, $gv->FILEGV->SV->PV, $gv->LINE); | |||||||||
| 28 | 1 | warn sprintf "Found evil variable \$%s in file %s, line %s\n", @report; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 63 | ▶ | sub B::OP::findampersand {} | ||||||||
|
Subroutine
findampersand: called CC=1 SCAR=0.0
| |||||||||||
| 32 | 0 | ▶ | *B::SVOP::findampersand = $] < 5.006 ? sub {} : sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 33 | 13 | shift->gv->findampersand; | |||||||||
| 34 | 1 | ▶ | }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 1 | ▶ | sub B::PMOP::findampersand {} | ||||||||
|
Subroutine
findampersand: called CC=1 SCAR=0.0
| |||||||||||
| 36 | 0 | ▶ | sub B::PVOP::findampersand {} | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=0.0
| |||||||||||
| 37 | 16 | ▶ | sub B::COP::findampersand {} | ||||||||
|
Subroutine
findampersand: called CC=1 SCAR=0.0
| |||||||||||
| 38 | 8 | ▶ | sub B::PV::findampersand {} | ||||||||
|
Subroutine
findampersand: called CC=1 SCAR=0.0
| |||||||||||
| 39 | 0 | ▶ | sub B::AV::findampersand {} | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=0.0
| |||||||||||
| 40 | 0 | ▶ | sub B::IV::findampersand {} | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=0.0
| |||||||||||
| 41 | 0 | ▶ | sub B::NV::findampersand {} | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=0.0
| |||||||||||
| 42 | 0 | ▶ | sub B::NULL::findampersand {} | ||||||||
|
Subroutine
findampersand: not called CC=1 SCAR=0.0
| |||||||||||
| 43 | 1 | ▶ | sub B::SPECIAL::findampersand {} | ||||||||
|
Subroutine
findampersand: called CC=1 SCAR=0.0
| |||||||||||
| 44 | |||||||||||
| 45 | 1 | 1; | |||||||||
| 46 | |||||||||||
| 47 | __END__ | ||||||||||