[Israel.pm] function prototypes

Shmuel Fomberg semuelf at 012.net.il
Thu Jun 12 13:04:29 PDT 2008


Hi All.

Mikhael Goikhman wrote:

>> I want to clarify that the call is suppose to do what the last statment 
>> does: when MetaField runs the sub, it will return the value inside 
>> $_->ctx->{length}. (and not that $_->ctx->{length} will contain the sub ref)
>>
>> The propose of this is to make it niffy. I need to make some info 
>> available to the function, so I thought to load it on an object, local 
>> $_ to it, and run the function.
>>
>> So why map/grep can work without sub{}, and I can't?
> 
> It was mentioned already that the magic only occurs on the first CODE
> argument (&...) and not on the following ones. The rational for this is
> simple, to allow such compact syntax, but make the balance between what
> is allowed and being ambiguous.

It was? I must have missed that in all the "interesting discussion" that 
took place.

> 	apply { "meaning of life" } on { 21 * 2 };

This is a cute idea. Don't think that it's applicatable in my program, 
but I'll keep that in mind.
Thanks for the detailed explanation.

Shmuel.



More information about the Perl mailing list