how to add switches to a perl program like plackup or dzil

SYNOPSIS

perl -d:Confess $( which dzil )  release

If you are using development tools like https://metacpan.org/pod/Devel::Confess or https://metacpan.org/pod/Devel::cst, and are trying to figure out how to use them with applications with a shebang like dzil, plackup, etc, the 'which' command is your friend. Invoking those scripts with perl should be effectively the same thing, and you can pass whatever switches you want to pass to perl.

See the comments for other ways to achieve the same thing.

CPAN Day winner?

I didn't think it was a contest but I think Ingy won CPAN Day....

View image

Perlmodules.net is awesome

Just a heads up that if you're not using perlmodules.net you should check it out.

I use News+ on my android phone to keep up with RSS feeds, so I find it super useful to be able to at a glance find out when modules that I use frequently have been updated, and what's changed.
I got my list of modules I'm following.

**Edited, fixed links to point to unprotected rss feed instead of logged in view, fixed relative to absolute url…

Web::Module::CoreList


Web::Module::CoreList - 'This is a web interface for Module::CoreList.'

Very cool and useful website, worth checking out.

As a web developer and perl programmer, I'd like to see ( and build ) more websites like this!

Moose MonkeyPatching With a Mock UserAgent

In this post: http://blogs.perl.org/users/samuel_kaufman/2014/06/when-a-fat-comma-is-confusing.html I mentioned I was using Test::LWP::UserAgent for my test. One thing I struggled with was testing ( with a mockup ) a service which was being instantiated completely beyond the scope of the test- so even though it took ua as a parameter to the constructor to override the default LWP::UserAgent->new, I couldn't reach down inside the Catalyst controller where it instantiated a module with the default parameters from the test.

So in case anyone else has had similar issues, here's how I got it working:

use Test::LWP::UserAgent;
use HTTP::Message::PSGI;
use Moose::Util qw[ find_meta ];

my $ua = Test::LWP::UserAgent->new(cookie_jar => {} );
my $meta = find_meta('SocialFlow::LinkShortening');
$meta->make_mutable;
$meta->add_around_method_modifier( ua => sub { $ua } );
$meta->make_immutable;
$ua->register_psgi( 'socialflow',$script->psgi_app);

It's not pretty, and I can think of plenty of reasons why this is a bad idea, but it works! Looking at it now I could've probably made 'ua' lazy_build and put an around modifier to hijack _build_ua but that's also breaking encapsulation....