Storable

 view release on metacpan or  search on metacpan

stacksize  view on Meta::CPAN

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# 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

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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.264 second using v1.01-cache-2.11-cpan-a5abf4f5562 )