Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Prototype question

by rovf (Priest)
on Sep 05, 2012 at 12:54 UTC ( #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>


Comment on Re^2: Prototype question
Download Code
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
Node Status?
node history
Node Type: note [id://991829]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (18)
As of 2014-07-31 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls