p4raw-id: //depot/perl@32533
Perl_croak(aTHX_ "Can't bless non-reference value");
tmpRef = SvRV(sv);
if (SvFLAGS(tmpRef) & (SVs_OBJECT|SVf_READONLY)) {
+ if (SvIsCOW(tmpRef))
+ sv_force_normal_flags(tmpRef, 0);
if (SvREADONLY(tmpRef))
Perl_croak(aTHX_ PL_no_modify);
if (SvOBJECT(tmpRef)) {
require './test.pl';
}
-plan (106);
+plan (108);
sub expected {
my($object, $package, $type) = @_;
$c4 = eval { bless \$test, $h1 };
is ($@, '', "class is an overloaded ref");
expected($c4, 'C4', "SCALAR");
+
+{
+ my %h = 1..2;
+ my($k) = keys %h;
+ my $x=\$k;
+ bless $x, 'pam';
+ is(ref $x, 'pam');
+
+ my $a = bless \(keys %h), 'zap';
+ is(ref $a, 'zap');
+}