PerlPowerTools
PerlPowerTools copied to clipboard
Use three-argument open
Many of the open-for-reading file handles didn't use three-argument open:
https://kritika.io/users/briandfoy/repos/7253941177493998/snapshots/1/violations?limit=20&page=1&rule=InputOutput%3A%3AProhibitTwoArgOpen
For example:
open FOO, $filename;
Add the default read mode in the middle:
open FOO, '<', $filename;
If you feel like it, change those to lexical file handles, although that's a much bigger change that you might not want to drag into this issue.
Do as many or as few of the problem files as you like. For Hacktoberfest, it doesn't matter how big or complete the pull request is. :)
I'm going to have a go at this issue
I fixed up a few things, and took care of most of the rest of them in e8d09609c3b3e23ba234600feb1cbbb92241c9e8.
I have a list of files that I still need to test in f33bdd36e1ba91c71eb28193128fddf5ce9cd141 (branch unchecked-three-args-open):
- [ ] awk
- [ ] deroff
- [ ] man
- [ ] patch