| 1 | package Alias::Any; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 6 | ▶ | use 5.012; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 6 | our $VERSION = '0.000007'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 6 | ▶ | use Keyword::Simple; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | # Make 'keyword' and 'unkeyword' no-ops, unless Keyword::Declare is later loaded... | ||||||||||||||||||||
| 11 | 6 | ▶ | BEGIN { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
| |||||||||||||||||||||
| 12 | 0 | ▶ | sub _delete_source { my $ref = shift; $$ref =~ s{ \A .*? [#]END_OF_ALIAS }{}xms; } | ||||||||||||||||||
|
Subroutine
_delete_source: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 13 | 6 | Keyword::Simple::define( keyword => \&_delete_source ); | |||||||||||||||||||
| 14 | 6 | Keyword::Simple::define( unkeyword => \&_delete_source ); | |||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 7 | ▶ | sub import { | ||||||||||||||||||
|
Subroutine
import: called CC=4 SCAR=17.4
| |||||||||||||||||||||
| 18 | # Below 5.22, alias keyword just injects Data::Alias... | ||||||||||||||||||||
| 19 | 7 | ▶ | if ($^V < 5.022) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 20 | Keyword::Simple::define( | ||||||||||||||||||||
| 21 | 0 | ▶ | alias => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 22 | 0 | my $ref = shift; | |||||||||||||||||||
| 23 | 0 | $$ref = q{use Data::Alias; Data::Alias::alias} . $$ref; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | 0 | ); | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | # Above 5.22, alias keyword replaced with built-in syntax... | ||||||||||||||||||||
| 29 | 6 | ▶ | use if $^V >= 5.022, 'Keyword::Declare'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 30 | 7 | ||||||||||||||||||||
| 31 | 0 | ▶ | keyword alias (Variable|VariableDeclaration $variable, '=', Expr $expr) {{{ | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=1.3
Subroutine
__ANON__: not called CC=1 SCAR=1.3
Branch: 1 branch
Condition50%1/2
(caller 0)[3] // ""
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
| |||||||||||||||||||||
| 32 | 0 | use feature 'refaliasing'; | |||||||||||||||||||
| 33 | 0 | no warnings 'experimental::refaliasing'; | |||||||||||||||||||
| 34 | \<{$variable}> = \<{$expr}> | ||||||||||||||||||||
| 35 | 0 | }}} #END_OF_ALIAS | |||||||||||||||||||
| 36 | 0 | } | |||||||||||||||||||
| 37 | 0 | ||||||||||||||||||||
| 38 | 2 | ▶ | sub unimport { | ||||||||||||||||||
|
Subroutine
unimport: called CC=5 SCAR=18.6
| |||||||||||||||||||||
| 39 | 0 | # Below 5.22, alias keyword is undefined by Keyword::Simple... | |||||||||||||||||||
| 40 | 2 | ▶ | if ($^V < 5.022) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 0 | Keyword::Simple::undefine('alias'); | |||||||||||||||||||
| 42 | 0 | ▶ | if ($Keyword::Simple::VERSION < 0.04) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | 0 | $^H{'Keyword::Simple/keywords'} =~ s{ alias:(?:\d+|-\d*)}{}g; | |||||||||||||||||||
| 44 | 7 | ▶ | } | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 45 | 6 | } | |||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | # Above 5.22, alias keyword is unkeyworded by Keyword::Declare... | ||||||||||||||||||||
| 48 | 6 | ▶ | use if $^V >= 5.022, 'Keyword::Declare'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 49 | 2 | ▶ | unkeyword alias; #END_OF_ALIAS | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
(caller 0)[3] // ""
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
| |||||||||||||||||||||
| 50 | 2 | } | |||||||||||||||||||
| 51 | 6 | ▶ | |||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 52 | 6 | ||||||||||||||||||||
| 53 | 6 | 1; # Magic true value required at end of module | |||||||||||||||||||
| 54 | __END__ | ||||||||||||||||||||