PERL_ARGS_ASSERT_SV_SETPVN;
SV_CHECK_THINKFIRST_COW_DROP(sv);
+ if (isGV_with_GP(sv))
+ Perl_croak_no_modify();
if (!ptr) {
(void)SvOK_off(sv);
return;
my $bas_tests = 21;
# number of tests in section 3
-my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 6 + 2 + 3 + 96 + 11 + 4;
+my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 6 + 2 + 3 + 96 + 11 + 12;
# number of tests in section 4
my $hmb_tests = 37;
{ stderr => 1 },
'#128255 Assert fail in S_sublex_done');
+{
+ $^A = "";
+ my $a = *globcopy;
+ my $r = eval { formline "^<<", $a };
+ is $@, "";
+ ok $r, "^ format with glob copy";
+ is $^A, "*ma", "^ format with glob copy";
+ is $a, "in::globcopy", "^ format with glob copy";
+}
+
+{
+ $^A = "";
+ my $r = eval { formline "^<<", *realglob };
+ like $@, qr/\AModification of a read-only value attempted /;
+ is $r, undef, "^ format with real glob";
+ is $^A, "*ma", "^ format with real glob";
+ is ref(\*realglob), "GLOB";
+}
+
+$^A = "";
#############################
## Section 4