| 1 | # | ||||||||||||
| 2 | # This file is part of Moo-Lax | ||||||||||||
| 3 | # | ||||||||||||
| 4 | # This software is Copyright (c) 2014 by Damien Krotkine. | ||||||||||||
| 5 | # | ||||||||||||
| 6 | # This is free software, licensed under: | ||||||||||||
| 7 | # | ||||||||||||
| 8 | # The Artistic License 2.0 (GPL Compatible) | ||||||||||||
| 9 | # | ||||||||||||
| 10 | package oo::Lax; | ||||||||||||
| 11 | 1 | $oo::Lax::VERSION = '2.00'; | |||||||||||
| 12 | #ABSTRACT: Loads oo without turning warnings to fatal. | ||||||||||||
| 13 | |||||||||||||
| 14 | |||||||||||||
| 15 | 1 | ▶ | use Moo::_Utils; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | |||||||||||||
| 17 | |||||||||||||
| 18 | 0 | ▶ | sub moo { | ||||||||||
|
Subroutine
moo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 19 | 0 | print <<'EOMOO'; | |||||||||||
| 20 | _________________ | ||||||||||||
| 21 | < Moo, but relax! > | ||||||||||||
| 22 | ----------------- | ||||||||||||
| 23 | \ ^__^ | ||||||||||||
| 24 | \ (oo)\_______ | ||||||||||||
| 25 | (__)\ )\/\ | ||||||||||||
| 26 | ||----w | | ||||||||||||
| 27 | || || | ||||||||||||
| 28 | EOMOO | ||||||||||||
| 29 | 0 | exit 0; | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 1 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 33 | 1 | my $package; | |||||||||||
| 34 | 0 | ▶ | sub import { | ||||||||||
|
Subroutine
import: not called CC=4 SCAR=30.0
| |||||||||||||
| 35 | 0 | ▶ | moo() if $0 eq '-'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 0 | ▶ | $package = $_[1] || 'Class'; | ||||||||||
|
Condition0%0/2
$_[1] || 'Class'
MC/DC0%0/1
$_[1] || 'Class'
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||
| 37 | 0 | ▶ | if ($package =~ /^\+/) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 0 | $package =~ s/^\+//; | |||||||||||
| 39 | 0 | _load_module($package); | |||||||||||
| 40 | } | ||||||||||||
| 41 | } | ||||||||||||
| 42 | 0 | ▶ | use Filter::Simple sub { s/^/package $package;\nuse Moo::Lax;\n/; } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 43 | 1 | } | |||||||||||
| 44 | |||||||||||||
| 45 | 1 | 1; | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||