Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: prototypes: so many \@'s?

by Moron (Curate)
on Apr 03, 2007 at 16:00 UTC ( #608091=note: print w/replies, xml ) Need Help??


in reply to prototypes: so many \@'s?

I tried (@\@) but that accepted any old thing (doh!). perlsub does warn you the prototyping capability is limited!

You could always roll your own at run-time, something like (untested):

our %proto = ( '@\@' => sub { return !grep (ref( $_ ) ne 'ARRAY' ), @_ +; }, # ... # proto => sub { enforcement-code } ); sub foo { $proto{ '@\@' }{@_} or die; # followed by "real" code for sub foo }

-M

Free your mind

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://608091]
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: (4)
As of 2019-12-13 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?