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

Re: module loading built-in

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
September 17, 2022 10:59
Subject:
Re: module loading built-in
Message ID:
20220917115847.6239d0d9@shy.leonerd.org.uk
On Fri, 16 Sep 2022 17:55:36 -0700
Darren Duncan <darren@darrenduncan.net> wrote:

> I feel the simplest solution is just alter the original RFC to be 
> builtin::load($package_name) etc rather than unqualified "load".
> That seems the most appropriate and simplest way to do this.  This is
> the kind of thing that builtin:: is for.

Oh, I hadn't quite picked up or commented on that subtlety.

The original RFC was mostly written before the "builtin" mechanism was
finalised. I think in everyone's head who was looking at the original
writing, we all imagined it would be in `builtin::` - I've just been
assuming that while reading it and hadn't actually noticed.

If it isn't explicitly spelled out in words, then yes it ought to be so.

  builtin::load($module);

or

  use builtin 'load';
  load($module);

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About