On Sat, 17 Sep 2022 03:53:53 -0700 Darren Duncan <darren@darrenduncan.net> wrote: > > I don't see what a builtin would add. > > > > eval "use $module; 1" > > > > Works fine. > > Why? Its because having to use string eval for something so simple > and basic is a TERRIBLE design, a huge code smell. The proposal of a > proper basic runtime-defined load that DOESN'T use string eval is > sorely needed. This is insecure and error prone like SQL injection > from straight interpolation of variables into the raw source when it > should just be a plain value or argument. +1. (Well, +2 if I could ;) ) Plus also Yves' code didnt' handle errors; you forgot to eval "use $module; 1" or die $@; and already we see why builtin::load $module; would be much nicer. -- 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