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

Re: Questions about the my Foo $var syntax

Thread Previous | Thread Next
Kang-min Liu
March 14, 2023 00:15
Re: Questions about the my Foo $var syntax
Message ID:
於 2023年3月13日 下午8:29:40 [GMT+09:00],Robert Rothenberg <> 寫到:
>  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?

It is briefly mentioned in perlfunc `my`.

The documemt doesn't says what the token should do, but just refer it as TYPE.

I haven't search further but I do remember  seeing it somewhere else.

Kang-min Liu

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