Storable

 view release on metacpan or  search on metacpan

stacksize  view on Meta::CPAN

# instead so a user setting of either variable more closely matches
# the limits the use sees.

# be fairly aggressive in trimming this, smoke testing showed
# several apparently random failures here, eg. working in one
# configuration, but not in a very similar configuration.
$max_depth = int(0.6 * $max_depth);
$max_depth_hash = int(0.6 * $max_depth_hash);

my $stack_reserve = $^O eq "MSWin32" ? 32 : 16;
if ($] ge "5.016" && !($^O eq "cygwin" && $ptrsize == 8)) {
    $max_depth -= $stack_reserve;
    $max_depth_hash -= $stack_reserve;
}
else {
    # within the exception we need another stack depth to recursively
    # cleanup the hash
    $max_depth = ($max_depth >> 1) - $stack_reserve;
    $max_depth_hash = ($max_depth_hash >> 1) - $stack_reserve * 2;
}

t/utf8.t  view on Meta::CPAN


my $x = chr(1234);
is($x, ${thaw freeze \$x});

# Long scalar
$x = join '', map {chr $_} (0..1023);
is($x, ${thaw freeze \$x});

# Char in the range 127-255 (probably) in utf8.  This just won't work for
# EBCDIC for early Perls.
$x = ($] lt 5.007_003) ? chr(175) : chr(utf8::unicode_to_native(175))
   . chr (256);
chop $x;
is($x, ${thaw freeze \$x});

# Storable needs to cope if a frozen string happens to be internal utf8
# encoded

$x = chr 256;
my $data = freeze \$x;
is($x, ${thaw $data});



( run in 0.513 second using v1.01-cache-2.11-cpan-cc502c75498 )