| 1 | # | ||||||||||||
| 2 | # This file is part of autobox-Base64 | ||||||||||||
| 3 | # | ||||||||||||
| 4 | # This software is Copyright (c) 2013 by Chris Weyl. | ||||||||||||
| 5 | # | ||||||||||||
| 6 | # This is free software, licensed under: | ||||||||||||
| 7 | # | ||||||||||||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||||||||||||
| 9 | # | ||||||||||||
| 10 | package autobox::Base64; | ||||||||||||
| 11 | { | ||||||||||||
| 12 | 2 | $autobox::Base64::VERSION = '0.001'; | |||||||||||
| 13 | } | ||||||||||||
| 14 | |||||||||||||
| 15 | # ABSTRACT: Convert strings to and from base64 easily | ||||||||||||
| 16 | |||||||||||||
| 17 | 2 | ▶ | use v5.10; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 2 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | |||||||||||||
| 22 | 2 | ▶ | use parent 'autobox'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | |||||||||||||
| 24 | 1 | ▶ | sub import { shift->SUPER::import(STRING => 'autobox::Base64::STRING') } | ||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||
| 25 | |||||||||||||
| 26 | |||||||||||||
| 27 | { | ||||||||||||
| 28 | package autobox::Base64::STRING; | ||||||||||||
| 29 | { | ||||||||||||
| 30 | 2 | $autobox::Base64::STRING::VERSION = '0.001'; | |||||||||||
| 31 | } | ||||||||||||
| 32 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 33 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 34 | 2 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 35 | |||||||||||||
| 36 | 2 | ▶ | use MIME::Base64 (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 37 | |||||||||||||
| 38 | 3 | ▶ | sub decode_base64 { MIME::Base64::decode_base64(shift) } | ||||||||||
|
Subroutine
decode_base64: called CC=1 SCAR=0.0
| |||||||||||||
| 39 | 1 | ▶ | sub from_base64 { goto \&decode_base64 } | ||||||||||
|
Subroutine
from_base64: called CC=1 SCAR=0.0
| |||||||||||||
| 40 | |||||||||||||
| 41 | 3 | ▶ | sub encode_base64 { MIME::Base64::encode_base64(shift, shift // undef) } | ||||||||||
|
Subroutine
encode_base64: called CC=2 SCAR=7.6
Condition50%1/2
shift() // undef
MC/DC0%0/1
shift() // undef
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 42 | 1 | ▶ | sub to_base64 { goto \&encode_base64 } | ||||||||||
|
Subroutine
to_base64: called CC=1 SCAR=0.0
| |||||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 2 | !!42; | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||