We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7b77ff commit e7240d2Copy full SHA for e7240d2
t/op/goto-sub.t
@@ -7,10 +7,10 @@ BEGIN {
7
require './charset_tools.pl';
8
}
9
10
+use v5.16;
11
use warnings;
-use strict;
12
use Config;
13
-plan tests => 40;
+plan tests => 41;
14
15
# Excerpts from 'perldoc -f goto' as of perl-5.40.1 (Aug 2025)
16
#
@@ -358,6 +358,21 @@ SKIP:
358
359
360
361
+# GH 23804 goto __SUB__
362
+{
363
+ my $fac = sub {
364
+ unshift @_, 1;
365
+ goto sub {
366
+ my ($acc, $i) = @_;
367
+ return $acc if $i < 2;
368
+ @_ = ($acc * $i, $i - 1);
369
+ goto __SUB__;
370
+ };
371
372
+
373
+ is $fac->(5), 120, 'recursion via goto __SUB__';
374
+}
375
376
# Final test: ensure that we saw no deprecation warnings
377
# ... but rework this to count fatalizations once work is more developed
378
0 commit comments