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

Re: Questions about the my Foo $var syntax

Thread Previous | Thread Next
From:
Kang-min Liu
Date:
March 14, 2023 00:15
Subject:
Re: Questions about the my Foo $var syntax
Message ID:
1589359A-705C-46A2-A456-2269FCB00C9B@gugod.org
於 2023年3月13日 下午8:29:40 [GMT+09:00],Robert Rothenberg <rrwo@cpan.org> 寫到:
>  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?



https://perldoc.perl.org/functions/my

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About