| Server IP : 162.214.67.83 / Your IP : 216.73.217.31 Web Server : Apache System : Linux dedi-13542965.clustter.com.br 5.14.0-687.20.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 30 06:22:49 EDT 2026 x86_64 User : jforte ( 1063) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/.cpan/build/Storable-3.25-0/t/ |
Upload File : |
#!./perl
sub BEGIN {
unshift @INC, 't';
unshift @INC, 't/compat' if $] < 5.006002;
require Config; import Config;
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
print "1..0 # Skip: Storable was not built\n";
exit 0;
}
}
use Storable ();
use Test::More tests => 3;
our $f;
package TIED_HASH;
sub TIEHASH { bless({}, $_[0]) }
sub STORE {
$f = Storable::freeze(\$_[2]);
1;
}
package TIED_ARRAY;
sub TIEARRAY { bless({}, $_[0]) }
sub STORE {
$f = Storable::freeze(\$_[2]);
1;
}
package TIED_SCALAR;
sub TIESCALAR { bless({}, $_[0]) }
sub STORE {
$f = Storable::freeze(\$_[1]);
1;
}
package main;
my($s, @a, %h);
tie $s, "TIED_SCALAR";
tie @a, "TIED_ARRAY";
tie %h, "TIED_HASH";
$f = undef;
$s = 111;
is $f, Storable::freeze(\111);
$f = undef;
$a[3] = 222;
is $f, Storable::freeze(\222);
$f = undef;
$h{foo} = 333;
is $f, Storable::freeze(\333);
1;