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

Re: Pre-RFC: A built-in ability for lexical import/export

Thread Previous | Thread Next
June 27, 2022 17:11
Re: Pre-RFC: A built-in ability for lexical import/export
Message ID:
On Mon, Jun 27, 2022 at 5:30 PM Paul "LeoNerd" Evans <>

> >   * 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

Curtis "Ovid" Poe
CTO, All Around the World
World-class software development and consulting

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