| 1 | package Petal::Utils::Decode; | ||||||||||||
| 2 | |||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 4 | ▶ | use warnings::register; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 4 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 4 | ▶ | use base qw( Petal::Utils::Base ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 4 | ▶ | use constant name => 'decode'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 4 | ▶ | use constant aliases => qw(); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 4 | our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1]; | |||||||||||
| 14 | 4 | our $REVISION = (split(/ /, ' $Revision: 1.3 $ '))[2]; | |||||||||||
| 15 | |||||||||||||
| 16 | 16 | ▶ | sub process { | ||||||||||
|
Subroutine
process: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||
| 17 | 16 | my $class = shift; | |||||||||||
| 18 | 16 | my $hash = shift; | |||||||||||
| 19 | 16 | ▶ | my $args = shift || confess( "'decode' expects at least 1 variable (got nothing)!" ); | ||||||||||
|
Condition50%1/2
shift() || confess(q['decode' expects at least 1 variable (got nothing)!])
MC/DC0%0/1
shift() || confess(q['decode' expects at least 1 variable (got nothing)!])
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 20 | |||||||||||||
| 21 | 16 | my @tokens = $class->split_args( $args ); | |||||||||||
| 22 | |||||||||||||
| 23 | 16 | my $tvar = $class->fetch_arg($hash, shift @tokens); | |||||||||||
| 24 | 4 | ▶ | use Data::Dumper; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 25 | 16 | ▶ | while(@tokens) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 21 | my $a = $class->fetch_arg($hash, shift @tokens); | |||||||||||
| 27 | 21 | my $b = $class->fetch_arg($hash, shift @tokens); | |||||||||||
| 28 | 21 | ▶ | return $a unless defined($b); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 15 | ▶ | return $b if ($tvar =~ /$a/); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | } | ||||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | |||||||||||||
| 34 | |||||||||||||
| 35 | 4 | 1; | |||||||||||
| 36 | |||||||||||||
| 37 | __END__ | ||||||||||||