NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Sub::Current for the Win! (Score:1)
See, this is exactly why I love Perl, cause there is always a something on CPAN that will make your life easier.
- Stevan
Re: (Score:2)
That's great, but solve my 'yield' problem and I'll really love you :)
Re:Sub::Current for the Win! (Score:1)
Well, all the "yield" and "block" stuff is just sugar around your basic continuation passing. So here is the translation of what the ruby is actually doing.
I tried wrapping some sugar around this, but it gets really messy with scoping. I suspect to do it right, you would need to do what Ruby does and make the subs into objects (Proc is what it is called in Ruby IIRC) and then wrap the sugar around that. Autobox might help here too, if for nothing more than removing the need to actually bless the subs.
- Stevan
Reply to This
Parent