Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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

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.


    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 a moth chases the moon...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2018-05-20 18:24 GMT
Find Nodes?
    Voting Booth?