Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: make subroutine that takes expression as implicit block as first arg

by LanX (Saint)
on Aug 13, 2010 at 19:56 UTC ( [id://854997]=note: print w/replies, xml ) Need Help??


in reply to make subroutine that takes expression as implicit block as first arg

> The block part is easy; but is it possible to make it do the expression part?

no, unfortunately there's no prototype mechanism for the latter.

You can neither easily allow calling a function (which is a special case of the expression part).

There was a discussion about this a year ago, I will update a link.

UPDATE:

see coderefs and (&) prototypes and The & prototype and code references in scalars..

Cheers Rolf

  • Comment on Re: make subroutine that takes expression as implicit block as first arg

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-25 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found