Closed paultcochrane closed 7 years ago
I don't see an obvious way to add my local changes to this pull request (I'm relatively new to collaboration with GitHub). If that's possible, let me know how; otherwise, I'll add them in after I hear from you about PNM.pm.
I looked through the issues with strict vars in PDF/API2.pm and was able to eliminate them, so I've merged this pull request manually, including the changes mentioned above, and removing strict subs from PNM.pm.
Thanks for the push to get this done. :-)
No worries! Only too pleased to help! The reason why the no strict 'subs'
was in that patch was because there were still bareword filehandles floating around, and the only way to get things to compile with use strict
is to turn strict off on subs. Of course, since the other patch removing the bareword filehandles was merged before this patch, consequently the no strict 'subs'
was no longer necessary.
Am really stoked that you're merging these changes :-) They're mostly trivial/cosmetic changes, however I hope they're useful!
... where every module in the distribution now uses the
strict
pragma. Only inPDF::API2
was it necessary to turn off strict for'vars'
. The reason being the options passed around are sometimes handles as arrays and other times as hashes and it would require lots of digging to sort that particular issue out. Nevertheless, it was possible to addstrict
to all modules where this was missing and to make any variables lexical which weren't already so. In many cases thenew_api
method needed to have the$self
variable made lexical and this happened so often, and with the same structure that it looked like this was a copy-paste issue. Nevertheless, this variable is now lexical insidenew_api
throughout the code. The tests all pass and theTest::Kwalitee::Extra
tests no longer complain thatuse strict
isn't used throughout the distribution. This change should thus fix theuse_strict
CPANTS violation and allows the distribution to use current Perl best practice.This PR is submitted in the hope that it is helpful. If it can be improved in any way, please just let me know and I'll update it appropriately and resubmit.