Front page | perl.perl5.porters |
Postings from February 2022
From: Felipe Gasper
February 18, 2022 16:41
Message ID: 7E3F2CE6-F8F6-4A2B-A7C5-C6B36C3D0B80@felipegasper.com
What if Perl included a feature to “auto-require” missing namespaces?
That way you could, if we made a new “-R” flag to enable this feature, do:
perl -Re 'print JSON::to_json(["foo"])'
… and Perl would, when it sees that there’s no JSON::to_json() function defined, do a `require JSON` and then re-attempt.
It’s not the kind of thing I’d advocate for more substantive projects, but for one-liners it’d be a boon.
by Felipe Gasper