Skip to content

Conversation

mauke
Copy link
Contributor

@mauke mauke commented Aug 30, 2024

Previously, only ">&" used to exempt the third open argument from
"strict subs":

use strict;
open my $fh1, ">&", STDOUT;   # bareword allowed
open my $fh2, ">>&", STDOUT;  # error: Bareword "STDOUT" not allowed

Now all dup modes (>&, >>&, <&, +>&, +>>&, +<&) allow bareword
filehandles.

Fixes #22464.

mauke added 2 commits August 30, 2024 10:57
Previously, only ">&" used to exempt the third open argument from
"strict subs":

    use strict;
    open my $fh1, ">&", STDOUT;   # bareword allowed
    open my $fh2, ">>&", STDOUT;  # error: Bareword "STDOUT" not allowed

Now all dup modes (>&, >>&, <&, +>&, +>>&, +<&) allow bareword
filehandles.

Fixes Perl#22464.
Previously, only ">&" was tested (and other modes didn't work).

Now all 6 dup modes are tested (and 6 non-dup modes to verify that
barewords are still disallowed otherwise).
Copy link
Contributor

@tonycoz tonycoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, though it looks like I might have missed a no_bareword_filehandle() check

@mauke mauke merged commit da66962 into Perl:blead Sep 3, 2024
@mauke mauke deleted the fix-22464-open-dup-strict branch September 3, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants