File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -13487,8 +13487,11 @@ Perl_ck_open(pTHX_ OP *o)
13487
13487
(oa = OpSIBLING(first)) && /* The fh. */
13488
13488
(oa = OpSIBLING(oa)) && /* The mode. */
13489
13489
S_is_dup_mode(oa) && /* A dup open. */
13490
- (last == OpSIBLING(oa))) /* The bareword. */
13491
- last->op_private &= ~OPpCONST_STRICT;
13490
+ (last == OpSIBLING(oa))) { /* The bareword. */
13491
+ if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED)
13492
+ no_bareword_filehandle(SvPVX(cSVOPx_sv(last)));
13493
+ last->op_private &= ~OPpCONST_STRICT;
13494
+ }
13492
13495
}
13493
13496
{
13494
13497
/* mark as special if filename is a literal undef */
Original file line number Diff line number Diff line change @@ -556,3 +556,15 @@ Beta
556
556
stdout
557
557
>Delta
558
558
>Epsilon
559
+ ########
560
+ # NAME bareword handle in open dup handle calls
561
+ use strict;
562
+ open BAREWORD, ">&", STDOUT;
563
+ open my $fh2, ">&", BAREWORD;
564
+ no feature "bareword_filehandles";
565
+ open my $fh3, ">&", STDOUT;
566
+ open my $fh4, ">&", BAREWORD;
567
+ EXPECT
568
+ OPTIONS fatal
569
+ Bareword filehandle "BAREWORD" not allowed under 'no feature "bareword_filehandles"' at - line 6.
570
+ Execution of - aborted due to compilation errors.
You can’t perform that action at this time.
0 commit comments