Re: passing code inside function

2003-12-09 Thread Rob Dixon
Hi Marcos. First let's remove some fog from your code. Your anonymous subroutine sub {$_ = 5;} is returning the value '5' because that's the value of the assignment operator '='. The assigment to $_ is serving no useful purpose as $_ isn't used anywhere else. So we can reduce this to sub {

Re: passing code inside function

2003-12-09 Thread Tassilo von Parseval
On Tue, Dec 09, 2003 at 09:14:52AM +0100 [EMAIL PROTECTED] wrote: > I would like to read something about passing code inside function. Lets say > that: > > This works: > perl -e 'sub a(&){print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach 1..100' > &

RE: passing code inside function

2003-12-09 Thread Marcos . Rebelo
t: Re: passing code inside function On Dec 9, 2003, at 12:14 AM, [EMAIL PROTECTED] wrote: > I would like to read something about passing code inside function. > Lets say > that: > > This works: > perl -e 'sub a(&){print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach

Re: passing code inside function

2003-12-09 Thread drieux
On Dec 9, 2003, at 12:14 AM, [EMAIL PROTECTED] wrote: I would like to read something about passing code inside function. Lets say that: This works: perl -e 'sub a(&){print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach 1..100' what you might want to think about is trying tha

passing code inside function

2003-12-09 Thread Marcos . Rebelo
I would like to read something about passing code inside function. Lets say that: This works: perl -e 'sub a(&){print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach 1..100' This don't work perl -e 'sub a{print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach 1.