Skip to content

Commit dc5dfa2

Browse files
committed
Make error message easier to type
Using single- or double-quotation marks in an error message shortens one's life. Standardizing on "Use of goto to jump" avoids this and is consistent with the majority of such messages which begin with 'Use of'.
1 parent acd95cf commit dc5dfa2

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

pod/perldiag.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7826,6 +7826,10 @@ valid for UTF-8 locales, which the current locale isn't. This doesn't
78267826
make sense. Perl will continue, assuming a Unicode (UTF-8) locale, but
78277827
the results are likely to be wrong.
78287828

7829+
=item Use of goto to jump into a construct is no longer permitted
7830+
7831+
(F) More TO COME.
7832+
78297833
=item Use of freed value in iteration
78307834

78317835
(F) Perhaps you modified the iterated array within the loop?

pp_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,7 @@ PP(pp_goto)
36523652
? 2
36533653
: 1;
36543654
if (enterops[i])
3655-
croak("Use of \"goto\" to jump into a construct is no longer permitted");
3655+
croak("Use of goto to jump into a construct is no longer permitted");
36563656
}
36573657

36583658
/* pop unwanted frames */

t/lib/croak/pp_ctl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ __END__
33
goto f;
44
foreach(1){f:}
55
EXPECT
6-
Use of "goto" to jump into a construct is no longer permitted at - line 1.
6+
Use of goto to jump into a construct is no longer permitted at - line 1.
77
########
88
# NAME goto into given
99
goto f;
1010
CORE::given(1){f:}
1111
EXPECT
12-
Use of "goto" to jump into a construct is no longer permitted at - line 1.
12+
Use of goto to jump into a construct is no longer permitted at - line 1.
1313
########
1414
# NAME goto from given topic expression
1515
CORE::given(goto f){f:}
1616
EXPECT
17-
Use of "goto" to jump into a construct is no longer permitted at - line 1.
17+
Use of goto to jump into a construct is no longer permitted at - line 1.
1818
########
1919
# NAME goto into expression
2020
no warnings 'deprecated';

t/uni/labels.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ is $d, 0, "Latin-1 labels are reachable";
8686
}
8787
};
8888
like($@,
89-
qr/Use of \"goto\" to jump into a construct is no longer permitted/,
89+
qr/Use of goto to jump into a construct is no longer permitted/,
9090
"Got expected error message");
9191
}

0 commit comments

Comments
 (0)