Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Strict to references of a particular Variable of particular type.

by Corion (Pope)
on Dec 02, 2005 at 13:03 UTC ( #513585=note: print w/replies, xml ) Need Help??


in reply to Re: Strict to references of a particular Variable of particular type.
in thread Strict to references of a particular Variable of particular type.

People avoid prototypes for enforcing argument types and argument count because prototypes do not enforce argument types or argument count:

sub foo ($) { print ">>$_[0]<<\n"; }; my @bar = (4,5,6); foo 1,2,3; foo @bar; foo(@bar);

I forgot to point to Tom Christiansens Far More Than You Ever Wanted To Know About Prototypes - it details the uses and abuses of prototypes, and my rule of thumb has been to avoid them unless I really need them.

  • Comment on Re^2: Strict to references of a particular Variable of particular type.
  • Download Code

Replies are listed 'Best First'.
Re^3: Strict to references of a particular Variable of particular type.
by Roger (Parson) on Dec 02, 2005 at 13:08 UTC
    Thanks for the clarification. The example was very helpful.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2019-06-25 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (107 votes). Check out past polls.

    Notices?