develooper Front page | perl.perl5.porters | Postings from March 2023

Re: Questions about the my Foo $var syntax

Thread Previous | Thread Next
Dave Mitchell
March 13, 2023 12:46
Re: Questions about the my Foo $var syntax
Message ID:
On Mon, Mar 13, 2023 at 11:29:40AM +0000, Robert Rothenberg wrote:
> 3. if not, are there plans to do something useful with it, e.g. enforce type
> constraints?

It can be used to enforce some compile-time and run-time constraints on
what keys are valid in a hash being used as an object. This can be set up
using the fields pragma.

But it's generally underused. It was added then mostly forgotten about.
Whoever added it may have had some grand visions of where they intended to
go with it, but that generation of perl core hackers are all long gone.

The Enterprise successfully ferries an alien VIP from one place to another
without serious incident.
    -- Things That Never Happen in "Star Trek" #7

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