Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Typed declarations?

by LanX (Chancellor)
on Apr 28, 2012 at 11:39 UTC( #967803=perlquestion: print w/replies, xml ) Need Help??
LanX has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I was asked if there are any practical consequences of typed declarations like in the following snippet

    my Gearman::Client $self = shift;

AFAI remember it's a placebo ...

(...but I thought it could be traced somehow in the Op-tree, so maybe any applications could be built on it ...)

Any insights?

Cheers Rolf

UPDATE: OK seems like from 5.10 on it's a deprecated fields feature and the syntax remains for backwards compability.

Replies are listed 'Best First'.
Re: Typed declarations?
by LanX (Chancellor) on Apr 28, 2012 at 14:05 UTC
    Hmm at least there seems to be a compilation time check for the existance of the package:

    lanx@nc10-ubuntu:~$ perl -c -e' my blabla $x;' No such class blabla at -e line 1, near "my blabla" -e had compilation errors.

    vs.

    lanx@nc10-ubuntu:~$ perl -c -e'{package blabla;} my blabla $x;' -e syntax OK

    Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://967803]
Approved by Perlbotics
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-08-29 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (409 votes). Check out past polls.