On Fri, 2006-23-06 at 13:01 -0400, Muttley Meen wrote:
> All this if foo has the prototype
> sub foo(&$)
>
> The question that I have is why isn't it possible to have
> the block reference as the second parameter, so foo would be called as :
Don't use prototypes. They were design for other things
On 6/23/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
On Fri, 2006-23-06 at 17:19 +0300, Muttley Meen wrote:
> I searched around for a construct to permit for a block
> of code to be passed as parameter, but with no success.
That's because you can't pass a block of code, you can only pass a
On Fri, 2006-23-06 at 17:19 +0300, Muttley Meen wrote:
> I searched around for a construct to permit for a block
> of code to be passed as parameter, but with no success.
That's because you can't pass a block of code, you can only pass a
reference to a block of code, or the text that can be compil
Hello,
You maybe want to pass a subroutine's reference to another subroutine.I
would modify your codes as follow:
use strict;
sub foo {
my $p1 = shift ;
my $p2 = shift ;
print "Param1 = $p1\n" ;
&$p2 ;
}
sub bar {
print "hello\n";
}
foo("test",\&bar);
It execute and get the resu