Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: prototypes: so many \@'s?

by Moron (Curate)
on Apr 03, 2007 at 16:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608091]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-20 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found