my $file = "xx-$$.pst";
is(eval { Storable::file_magic($file) }, undef, "empty file give undef");
-like($@, qr/^Can't open '\Q$file\E':/, "...and croaks");
+like($@, qq{/^Can't open '\Q$file\E':/}, "...and croaks");
is(Storable::file_magic(__FILE__), undef, "not an image");
store({}, $file);
ok($info, "got info");
is($info->{file}, $file, "file set");
is($info->{hdrsize}, 11 + length($Config{byteorder}), "hdrsize");
- like($info->{version}, qr/^2\.\d+$/, "sane version");
+ like($info->{version}, q{/^2\.\d+$/}, "sane version");
is($info->{version_nv}, Storable::BIN_WRITE_VERSION_NV, "version_nv match");
is($info->{major}, 2, "sane major");
ok($info->{minor}, "have minor");
ok($info->{minor} >= Storable::BIN_WRITE_MINOR, "large enough minor");
ok(!$info->{netorder}, "no netorder");
- for (qw(byteorder intsize longsize ptrsize nvsize)) {
- is($info->{$_}, $Config{$_}, "$_ match Config");
+
+ my %attrs = (
+ nvsize => 5.006,
+ ptrsize => 5.005,
+ map {$_ => 5.004} qw(byteorder intsize longsize)
+ );
+ for my $attr (keys %attrs) {
+ SKIP: {
+ skip "attribute $attr not available on this version of Perl", 1 if $attrs{$attr} > $];
+ is($info->{$attr}, $Config{$attr}, "$attr match Config");
+ }
}
}
ok($info, "got info");
is($info->{file}, $file, "file set");
is($info->{hdrsize}, 6, "hdrsize");
- like($info->{version}, qr/^2\.\d+$/, "sane version");
+ like($info->{version}, q{/^2\.\d+$/}, "sane version");
is($info->{version_nv}, Storable::BIN_WRITE_VERSION_NV, "version_nv match");
is($info->{major}, 2, "sane major");
ok($info->{minor}, "have minor");
}
# - is \W, so can't use \b at start. Negative look ahead and look behind
# works at start/end of string, or where preceded/followed by spaces
- if ($] == 5.008002 and $Config{'ccflags'} =~ /(?<!\S)-DDEBUGGING(?!\S)/) {
+ if ($] == 5.008002 and eval q{ $Config{'ccflags'} =~ /(?<!\S)-DDEBUGGING(?!\S)/ }) {
# Bug caused by change 21610, fixed by change 21849
print "1..0 # Skip: tickles bug in threads combined with -DDEBUGGING on 5.8.2\n";
exit 0;