Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Prototype question

by rovf (Priest)
on Sep 05, 2012 at 12:54 UTC ( [id://991829]=note: print w/replies, xml ) Need Help??


in reply to Re: Prototype question
in thread Prototype question

I know; however, if you want to use the "code block" syntax to call a function, you must define a prototype. At least Perl 5.8.8 (which I still have to use) does not provide an alternative.

My solution to my original problem was to use a cover function. Basically I define my function f without prototypes, and then add a function

sub g(&@) { &f }
to provide the ability to write codeblocks.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Prototype question
by CountZero (Bishop) on Sep 05, 2012 at 13:18 UTC
    Indeed you are right. I somehow missed the "code block" reference in your post or misread it as a anonymous sub reference. Sorry for that.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-29 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found