[baltimorepm] Closures and Late-Binding Subroutine Calls

Stephen Belcher sbelcher at gmail.com
Thu Apr 26 07:24:48 PDT 2012


Hi all,

I'm wondering if anyone has an answer to this?
https://gist.github.com/2499830

Essentially, I want to create a coderef while in the scope of one package,
and delay binding of the subroutine calls until the actual execution, which
will happen in or relative to another package, meaning that the subroutines
that eventually resolve will be the ones located in the second package, not
the first. This is different from what normally happens in closures.

I can think of a few ways around the problem I'm trying to solve which
aren't pretty, but I really like this one, cause I'm going for pretty, and
I hope the answer's not just "you can't do that in Perl without XS Dark
Magicks and/or a source filter".

--Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/baltimore-pm/attachments/20120426/d295d764/attachment.html>


More information about the Baltimore-pm mailing list