Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: passing array of args to prototyped subs

by pldanutz (Acolyte)
on Sep 10, 2013 at 05:35 UTC ( #1053165=note: print w/replies, xml ) Need Help??


in reply to Re: passing array of args to prototyped subs
in thread passing array of args to prototyped subs

Fine. I was under the impression that Perl prototypes were still minimally useful. I expected the compiler to check that f2 has 2 scalar args WHEN FEASIBLE (e.g. when the call is f2 ($a, $b, $c)) and ignore the prototype when compile-time checking is unfeasible. I guess it's too much.

Your link to a reply in another thread only proves that you can defeat compile-time prototype checking via using &f. however indirectly (which I knew)

  • Comment on Re^2: passing array of args to prototyped subs

Replies are listed 'Best First'.
Re^3: passing array of args to prototyped subs
by tobyink (Canon) on Sep 10, 2013 at 09:09 UTC

    Prototypes are useful; they're just not useful for checking the number and type of arguments to a function.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
    div class=

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-10-02 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (7 votes). Check out past polls.

    Notices?