Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 <>

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.


    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?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2015-03-28 12:25 GMT
Find Nodes?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:

    Results (625 votes), past polls