Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProhibitCallsToUndeclaredSubs false violations due to incomplete "%functions_that_take_filehandles" in Perl/Critic/StricterSubs/Utils.pm #15

Open
jjuarros opened this issue Oct 23, 2013 · 0 comments

Comments

@jjuarros
Copy link

hello,
reported violations here are cases where find_subroutine_calls()

takes bareword filehandles by function calls for opendir,reardir,closedir and syswrite

looking at the implementation ...
Perl::Critic::StricterSubs::Utils::find_subroutine_calls($doc)
uses my %functions_that_take_filehandles = hashify( qw(print printf read write sysopen tell open close) )
, for taking into account exactly that: functions that take filehandle as first argument.

This cures the false violations

$ diff Utils.ori Utils.pm
308c308
<     hashify( qw(print printf read write sysopen tell open close) );

---
>     hashify( qw(binmode close closedir eof fileno flock getc print printf open opendir read readdir rewinddir seek seekdir select sysopen sysread sysseek syswrite tell telldir truncate write) );
@petdance petdance transferred this issue from Perl-Critic/Perl-Critic Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant