develooper Front page | perl.perl5.porters | Postings from February 2022

pre-RFC: auto-require

Thread Next
Felipe Gasper
February 18, 2022 16:41
pre-RFC: auto-require
Message ID:
Hi all,

	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.



Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About