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

Questions about the my Foo $var syntax

Thread Next
From:
Robert Rothenberg
Date:
March 13, 2023 11:29
Subject:
Questions about the my Foo $var syntax
Message ID:
1e76d4b2-64e1-19b1-29a0-c1e0b6265bf4@cpan.org
There's some legacy syntax still used in some very old code bases, e.g. 
TheSchwartz

   my TheSchwartz::Job $job = shift;

As far as I can tell, this doesn't do anything except require that 
TheSchwartz::Job namespace exists. It doesn't require $job to be a 
TheSchwartz::Job.

I have some questions:

1. Is this documented anywhere still?

2. Is the syntax deprecated?

3. if not, are there plans to do something useful with it, e.g. enforce 
type constraints?



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