Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pod/perldiag.pod
Original file line number Diff line number Diff line change
Expand Up @@ -7923,6 +7923,10 @@ For speed and efficiency reasons, Perl internally does not do full
reference-counting of iterated items, hence deleting such an item in the
middle of an iteration causes Perl to see a freed value.

=item Use of "goto" to jump into a construct is no longer permitted

(F) More TO COME.

=item Use of /g modifier is meaningless in split

(W regexp) You used the /g modifier on the pattern for a C<split>
Expand Down
5 changes: 1 addition & 4 deletions pp_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3685,10 +3685,7 @@ PP(pp_goto)
}

if (into_construct)
deprecate_fatal_in(WARN_DEPRECATED__GOTO_CONSTRUCT,
"5.42",
"Use of \"goto\" to jump into a construct");

croak("Use of \"goto\" to jump into a construct is no longer permitted");

if (do_dump) {
#ifdef VMS
Expand Down
37 changes: 1 addition & 36 deletions t/comp/package_block.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!./perl

print "1..7\n";
print "1..5\n";

$main::result = "";
eval q{
Expand Down Expand Up @@ -55,38 +55,3 @@ eval q{
$main::result .= "f(".__LINE__.")";
};
print $main::result eq "a(2)b(4)c(6)d(8)e(10)f(12)" ? "ok 5\n" : "not ok 5\n";

$main::result = "";
$main::warning = "";
$SIG{__WARN__} = sub { $main::warning .= $_[0]; };
eval q{
$main::result .= "a(".__PACKAGE__."/".eval("__PACKAGE__").")";
goto l0;
$main::result .= "b(".__PACKAGE__."/".eval("__PACKAGE__").")";
package Foo {
$main::result .= "c(".__PACKAGE__."/".eval("__PACKAGE__").")";
l0:
$main::result .= "d(".__PACKAGE__."/".eval("__PACKAGE__").")";
goto l1;
$main::result .= "e(".__PACKAGE__."/".eval("__PACKAGE__").")";
}
$main::result .= "f(".__PACKAGE__."/".eval("__PACKAGE__").")";
l1:
$main::result .= "g(".__PACKAGE__."/".eval("__PACKAGE__").")";
goto l2;
$main::result .= "h(".__PACKAGE__."/".eval("__PACKAGE__").")";
package Bar {
l2:
$main::result .= "i(".__PACKAGE__."/".eval("__PACKAGE__").")";
}
$main::result .= "j(".__PACKAGE__."/".eval("__PACKAGE__").")";
};
print $main::result eq
"a(main/main)d(Foo/Foo)g(main/main)i(Bar/Bar)j(main/main)" ?
"ok 6\n" : "not ok 6\n";
print $main::warning =~ /\A
Use\ of\ "goto"\ [^\n]*\ line\ 3\.\n
Use\ of\ "goto"\ [^\n]*\ line\ 15\.\n
\z/x ? "ok 7\n" : "not ok 7\n";

1;
Loading
Loading