One of the minor annoyances I have when doing Perl coding is the necessity to remember to chomp a line that you read from input. Yeah, after years of coding it’s nearly automatic to remember to do so, but STILL annoying.
Is there any pragma, module or anything else in Perl (strongly preferred Core modules) that automatically chomps every line read using a <> operator?
Beyond the asquerous source filters that you already mentioned, I’m afraid I don’t know what counts as “a hack” for your purposes here. Do you consider any of these obviousish solutions to be “hacks”?
*CORE::readlinein the current package*CORE::GLOBAL::readlinein all packagesREADLINEmethod<>operatorHave you tried those yet?
Of those, I would think the first, or possibly the second, to be the most likely to do what you want with the least amount of fuss.
Note that all four of those solutions require nothing but pure Perl and nothing else. They do not even require any core modules, let alone any CPAN modules.