in reply to Passing an anonymous block to a method.

Are you just trying to avoid the 'sub' keyword?

$obj->method(sub { do something } ) ;

should work, I think.

-- Am I the only one who still cares about RT #67694?

Replies are listed 'Best First'.
Re^2: Passing an anonymous block to a method.
by BrowserUk (Patriarch) on Mar 10, 2011 at 18:48 UTC
    Are you just trying to avoid the 'sub' keyword?

    Effectively yes.

    For the same reasons as 99% of map and grep uses are coded as

    ... = map{ ... } ...

    rather than

    ... = map( sub{ ... }, ... );

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.