freelance writer
freelance writer
freelance writer
freelance writer
Thanks, Florian. - Dotan
Great work so far, to catch up any late readers, there's an ongoing conversation about this on IRC and I've blogged as well at:
http://jjnapiorkowski.vox.com/library/post/rethinking-catalyst-actions-and-controllers.html
http://jjnapiorkowski.vox.com/library/post/catalyst-actions-part-2-details-and-clarification.html
Athough I think at this point some of the stuff I wrote there my minds been changed on :) However people with useful dieas and willing to hack code welcome to join the discussion.
I encountered the same problem (and the same solution) a few years ago.
I created Test::NeedsDisplay which goes some way towards automating the spawning of xvfb-run when the host has no DISPLAY.
That's what the empty prototype in the anonymous sub that get's installed in the blog posts as well as MooseX::Lexical::Types on CPAN is for:
$meta->add_package_symbol('&'.$type_name => sub () { $decorator });
It allows you to tell perl that your function doesn't take any arguments and is constant. With that, it can be inlined, which means it will be called during compile time and the result will be put in the place where the function call was:
$ perl -le'{ package bob; } sub foo () { q{bob} }; my foo $bax = q{bax}; print $bax;'
bax
Note that the package, which name is returned by foo, still needs to exist.
This is dazzling, but what's an inlineable function and how do I get one? I can avoid the 'No such class' error by declaring a package, but not by declaring a sub.
perl -le 'my foo $bax = q{bax}; print $bax;'
No such class foo at -e line 1, near "my foo"
Execution of -e aborted due to compilation errors.
perl -le 'package foo; package main; my foo $bax = q{bax}; print $bax;'
bax
perl -le 'sub foo { q{bob} }; my foo $bax = q{bax}; print $bax;'
No such class foo at -e line 1, near "; my foo"
The login currently uses Crypg::OpenPGP, which is rather broken. Porting to Crypt::GpgME has been discussed, but it's probably not going to happen soon. I'd love to see Angerwhale support OpenID, but I'd rather just be blogging and have anonymous comments instead of wasting a lot of time on this. Sorry. :-/
This is awesome.
I tried to log in for a while, but angerwhale claims I'm not 0x9a0cda99... and I most certainly am. That login either needs better directions or smarter behaviors -- otherwise, openid is probably a better option.
That's a great tip. I've added a link from the CPAN Testers wiki at Tips and Tricks
-- dagolden