Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

Storable: stop using bareword file handles #22601

Closed haarg closed 1 month ago

haarg commented 1 month ago

Modernize the file handle use by using a lexical.

Using a bareword file handle actually led to a test failure in the CPAN module Patro. It uses an improper CORE::GLOBAL::flock override with an incorrect prototype. This prevents the use of barewords with flock(). While the bug here is in the CPAN module, avoiding bareword file handles will allow those tests to pass.

jkeenan commented 1 month ago

For reference, the upstream breakage report is here.

mauke commented 1 month ago

Looks good, but can we also remove the require IO::File code from sub file_magic? As far as I can tell, this is pre-5.6 compatibility logic. (In fact, it was for perl-5.004 compat: commit ab6f8ca1958822c.)

jkeenan commented 1 month ago

Looks good, but can we also remove the require IO::File code from sub file_magic? As far as I can tell, this is pre-5.6 compatibility logic. (In fact, it was for perl-5.004 compat: commit ab6f8ca.)

I would recommend that that be done in a separate pull request, as this pull request is in response to a BBC situation.