On Mon, Jun 27, 2022 at 1:11 PM Ovid <curtis.poe@gmail.com> wrote: > On Mon, Jun 27, 2022 at 5:30 PM Paul "LeoNerd" Evans < > leonerd@leonerd.org.uk> wrote: > >> > * Should it support things other than functions? Should we support >> > >> > lexically_export VAR => \my $scalar; >> >> And this. >> > > I'm concerned about this. Lexical import is designed to limit things to > the current scope and not expose them to the outside world. Because you're > exporting a reference, it's effectively a global variable. If more than one > bit of code imports that reference and alters it, other bits of code might > have already taken decisions based on that data, but the assumptions it > relied on are no longer true. > > I've just spent several days chasing down a bug that's caused by this and > I've had to do so multiple times for my current client. My client is losing > money paying me to fix design flaws rather than build the new features they > want. I'd rather not add another feature to Perl which encourages this > practice. > I don't entirely agree. It's no different in semantics to passing a variable to a function, which then has an alias to the variable to operate on. -DanThread Previous | Thread Next