* an SX_OBJECT indication, a ref count increment was done.
*/
- sv_upgrade(rv, SVt_RV);
+ if (cname) {
+ /* Do not use sv_upgrade to preserve STASH */
+ SvFLAGS(rv) &= ~SVTYPEMASK;
+ SvFLAGS(rv) |= SVt_RV;
+ } else {
+ sv_upgrade(rv, SVt_RV);
+ }
+
SvRV(rv) = sv; /* $rv = \$sv */
SvROK_on(rv);
use Storable qw(freeze thaw);
-print "1..10\n";
+print "1..12\n";
package SHORT_NAME;
do { $good = 0; last } unless ref $y->[4*$i+3] eq "${name}_WITH_HOOK";
}
ok 10, $good;
+
+{
+ my $blessed_ref = bless \\[1,2,3], 'Foobar';
+ my $x = freeze $blessed_ref;
+ my $y = thaw $x;
+ ok 11, ref $y eq 'Foobar';
+ ok 12, $$$y->[0] == 1;
+}
use Storable qw(store retrieve);
# problems with 5.00404 when in an BEGIN block, so this is defined here
-if (eval { require File::Spec; 1 } || $File::Spec::VERSION < 0.8) {
+if (!eval { require File::Spec; 1 } || $File::Spec::VERSION < 0.8) {
print "1..0 # Skip: File::Spec 0.8 needed\n";
exit 0;
# Mention $File::Spec::VERSION again, as 5.00503's harness seems to have