Is there a way to do this or something similar in Perl?
Not to the best of my knowledge. Perl doesn't have the concept of the "scope" objects in JavaScript. With the odd way that block scoped lexicals are handled I think it would be tricky to add/fake one (although I'm not an expert on the Perl internals so I could be wrong there).
Is this just a curiosity question or do you have a goal in mind? If so it might be useful to describe what you're trying to do since there is almost certainly way of doing it that doesn't involve rebinding closures :-)
In reply to Re: Rebinding closures, possible?
by adrianh
in thread Rebinding closures, possible?
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |