| 1 | package CGI::Session::Serialize::Base64; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Safe; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use MIME::Base64; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ($VERSION) = '$Revision: 0.1 $' =~ m/Revision:\s*(\S+)/; | |||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub freeze { | ||||||||
|
Subroutine
freeze: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | 0 | my ($self, $data) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 0 | local $Data::Dumper::Indent = 0; | |||||||||
| 18 | 0 | local $Data::Dumper::Purity = 0; | |||||||||
| 19 | 0 | local $Data::Dumper::Useqq = 1; | |||||||||
| 20 | 0 | local $Data::Dumper::Deepcopy = 0; | |||||||||
| 21 | |||||||||||
| 22 | 0 | my $d = new Data::Dumper([$data], ["D"]); | |||||||||
| 23 | 0 | return encode_base64($d->Dump()); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub thaw { | ||||||||
|
Subroutine
thaw: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 29 | 0 | my ($self, $Estring) = @_; | |||||||||
| 30 | |||||||||||
| 31 | 0 | my $string = decode_base64($Estring); | |||||||||
| 32 | |||||||||||
| 33 | # To make -T happy | ||||||||||
| 34 | 0 | my ($safe_string) = $string =~ m/^(.*)$/; | |||||||||
| 35 | |||||||||||
| 36 | 0 | my $D = undef; | |||||||||
| 37 | 0 | my $cpt = new Safe(); | |||||||||
| 38 | 0 | $D = $cpt->reval ($safe_string ); | |||||||||
| 39 | 0 | ▶ | if ( $@ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | die $@; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 0 | return $D; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | 1 | 1; | |||||||||
| 48 | |||||||||||
| 49 | __END__ | ||||||||||