THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Shuck & Awe #5: Hunting for Perl

[yanick@enkidu shuck]$  perl -MWWW::Robot
my $robot = WWW::Robot->new(
    NAME => 'shuck', VERSION => 0.1, EMAIL => 'blogger@pythian.com' );
$robot->addHook( 'follow-url-test' => sub { 1 } );
$robot->addHook( 'invoke-on-contents' => sub { print $_[5] if rand() > 0.5 } );
$robot->run( 'http://blogs.perl.com' );
^D

First, Inigo Tejedor reminds us that we have until Thursday June 3rd (yes, tomorrow) to fill out the Perl programming survey. If you haven’t done so already, what are you waiting for? Stop reading this blog entry right now and go do your duty. No, seriously, go!

And no peeking back until you’re done!

… so, survey’s filled out? Good. Now we can continue.

Read the rest of this entry . . .

Shuck & Awe #4: Hunting for Perl

[yanick@enkidu shuck]$ cat my_feeds | \
    perl -MXML::Feed \
         -ne'say( (XML::Feed->parse($_)->entries)[0]->summary ) if rand() > 0.5 '

Curtis Jewell followed up on an old post by Adam Kennedy and checked out if shuffling things around really improve compression. From the results, there seems to be very little blood to be squeezed out of that stone.

jjore came up with a very clever hack to stop the debugger when a test fails. Not only it is extremely useful, but the hack itself provides a lot of insight and food for thought for anyone attracted to the dark arts of under-the-Perl-interpreter-hood meddling.

Read the rest of this entry . . .

Shuck & Awe #3: Hunting for Perl

[yanick@enkidu shuck]$ echo "original json_pretty taken from hanekomu's tweet"
[yanick@enkidu shuck]$ cat news.json | perl -0007 -MJSON -nE"say for @{from_json(\$_)->{interesting}}"

Want to help Perl 6, and collect some booty in the process? Moritz Lenz has issued the first of a series of Perl 6 challenges. Fulfill the challenge, and get a chance to win mind-bogglingly fabulous prizes (well, okay, t-shirts for now). This week’s challenge doesn’t even require Perl 6 knowledge — it’s all about creating a website for proto.

Talking of Perl 6, masak announced the release of Yapsi, a Perl 6 compiler written in Perl 6.

Read the rest of this entry . . .

Shuck & Awe #2: Hunting for Perl

[yanick@enkidu shuck]$ tail -f news | perl -nE'say if /interesting/'

Huzzah! It’s official, Perl 5.12 is out! If you haven’t already, check out the changelog! As one might expect, this little piece of news made its way on several blogs, both internal and external to the Perl community.

Module authors, there are some other changes at the horizon for your modules’ META files as well. David Golden announced the release of version 2 of the CPAN META Spec. One of the biggest changes is the adoption of JSON (over YAML) as the preferred serialization format.

Plabo Marin-Garcias wrote about how to manage multiple local perl installations using perlbrew. If, for whatever reason, you have to juggle with more than one perl installation on the same machine App::perlbrew, written by Gugod, this might be a (gu)godsend that will make you sing hosannas for months to come…

In a nice little success story, chromatic tells us how Dist::Zilla, Github and Gitpan are helping to alleviate the complexity of distribution maintenance, turning what many consider a chore into… well, okay, still a chore, but at least a well-oiled, smoother one.

It’s a web framework smackdown! Adam Kennedy writes a series of articles in which he gets his feet wet with two modern Perl web frameworks:Mojolicious and Dancer.

All work and no play makes Jack a dull boy? No more! Kartik announced that the beloved game Frozen Bubble is now directly available on CPAN.

Sawyer X got fed-up of manually hunting for module versionsand created Module::Version to take care of the deed. Turned out he wasn’t the first to have that itch — in the comments people also recommended Module::Which and V.

On the microscopic side of things, garu shared a few shell aliases that will make your one-liner even tinier.

Tags. Everything taste better with tags. In consequence, Ovid presented a way to add tags to Test::Classtests.

Moose has a new website, Stevan Little reports. Because it’s not fun till it turns meta, the code producing the site is itself available via a git repository.

Finally, it looks like miyagawa went on a hacking frenzy. The result is Subana a cloud service that can run any Plack application.

^D
[yanick@enkidu shuck]$ perl -E'sleep 2 * 7 * 24 * 60 * 60 # see ya in 2 weeks!'

dpanneur – your friendly DarkPAN/CPAN proxy corner store

There were two things I have wanted to do for some time now. The first was to come up with a way to quickly and easily set up a DarkPAN mirror so that we would have more control over our dependency chain at work. The second was to make a portable CPAN proxy service, so that I can always have access to my favorite modules, even if the machine I’m working on has no Internet access. Last week, I finally had a few ‘rount tuits’ to spend on this type of background itch, and the result is dpanneur (for dépanneur, French Canadian for convenience store).

Installation

As it stands, dpanneur is a very thin Catalyst application gluing together the goodiness of CPAN::Cache and MyCPAN::App::DPAN, and throwing in Git as the archive manager.

To get it running, first fetch it from Github

$ git clone git://github.com/yanick/dpanneur.git

then check that you have all the dependencies

$ perl Makefile.PL

and run the script that will create the module repository

$ ./script/create_repo

For now, the module repository is hard-coded to be in the subdirectory cpan of dpanneur. A branch called proxy is created and checked out. Eventually, I’ll use GitStore to push newly fetched modules to the repository, but for the time being if dpanneur is to be used as a proxy, that branch must remain as the one being checked out.

All that is left is to fire up the server in whichever mode you prefer (single-thread test server would do nicely for now)

$ ./script/dpanneur_server.pl

and there you are, running your first dpanneur. Congrats! :-)

Using it as a caching proxy

You can use the server as a caching proxy, either for its own sake, or to seed the DarkPAN branches. To do that, you just have to configure your CPAN client to use http://yourmachine:3000/proxy:

$ cpan
cpan[1]> o conf urllist = http://localhost:3000/proxy
cpan[2]> reload index
cpan[3]> install Acme::EyeDrops
Running install for module 'Acme::EyeDrops'
Running make for A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz
Fetching with LWP:

http://localhost:3000/proxy/authors/id/A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz

etc..

As the modules are downloaded, they are also saved and committed within the repo

[dpanneur]$ cd cpan

[cpan (proxy)]$ git log -n 3
commit d065ad152f2204295334c5475104a3da517b6ae1
Author: Yanick Champoux <yanick@babyl.dyndns.org>
Date:   Wed Mar 10 20:32:52 2010 -0500

    authors/id/A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz

commit e8d2e83d1b16e2e0713d125f9a4bd2742681f859
Author: Yanick Champoux <yanick@babyl.dyndns.org>

Date:   Wed Mar 10 20:31:42 2010 -0500

    authors/id/D/DC/DCONWAY/Acme-Bleach-1.12.tar.gz

commit 7e0b4b600bac8424c519199ee96dc56ffbb177eb
Author: Yanick Champoux <yanick@babyl.dyndns.org>
Date:   Wed Mar 10 20:30:47 2010 -0500

    modules/03modlist.data.gz

Using it as a DarkPAN server

There is not much more involved to enabling DarkPAN repos. All we have to do is to create a branch with the modules we want and have the ‘dpan’ utility bundled with MyCPAN::App::DPAN generate the right files for us.

To continue with the example of the previous section, let’s say that we want a DarkPAN branch containing Acme::EyeDrops, but not Acme::Bleach. Then we’d do

                        # only necessary if you are running
                        # the server while you work on the branch
[dpanneur]$ git clone cpan cpan-work   

[dpanneur]$ cd cpan-work

                        # branch just before we imported Acme::Bleach
[cpan-work (proxy)]$ git branch pictoral 7e0b4b600bac8424c519199ee96dc56ffbb177eb

[cpan-work (proxy)]$ git checkout pictoral
Switched to branch 'pictoral'

                        # cherry-pick the Acme::EyeDrops commit
[cpan-work (pictoral)]$ git cherry-pick d065ad152f2204295334c5475104a3da517b6ae1

                        # rebuild the module list
[cpan-work (pictoral)]$ dpan

                        # commit the new 02packages.details.txt.gz
[cpan-work (pictoral)]$ git add .
[cpan-work (pictoral)]$ git commit -m "dpan processing"

                        # push back to the mothership
[cpan-work (pictoral)]$ git push origin pictoral

And that’s it. Now point the cpan client to http://yourmachine:3000/pictoral, and you’ll get the limited mirror.

cpan[1]> o conf urllist http://localhost:3000/pictoral
cpan[2]> reload index

cpan[3]> i Acme::EyeDrops
Strange distribution name [Acme::EyeDrops]
Module id = Acme::EyeDrops
    CPAN_USERID  ASAVIGE (Andrew J. Savige &lt;asavige@cpan.org>)
    CPAN_VERSION 1.55
    CPAN_FILE    A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz
    UPLOAD_DATE  2008-12-02
    MANPAGE      Acme::EyeDrops - Visual Programming in Perl
    INST_FILE    /usr/local/share/perl/5.10.0/Acme/EyeDrops.pm
    INST_VERSION 1.55

cpan[4]> i Acme::Bleach
Strange distribution name [Acme::Bleach]
No objects found of any type for argument Acme::Bleach

cpanvote: a Perl Mini-Project

The Itch

For many, CPAN is a Canadian Prairies-sized field of modules where it’s darn hard to separate the wheat from the chaff.

While the CPAN Ratings service is the principal and official way CPAN tries to rank its distributions, for me at least, it doesn’t quite scratch the itch because . . . 

  1. not all distributions have reviews.
  2. even when there are reviews, they generally don’t answer the next question: what should I use, instead?.

Read the rest of this entry . . .

Contributing to CPAN: PAUSE Id, Bug Tracking, and Code Repositories

CPAN Wants You!

CPAN Wants You!

Want to contribute to your favorite CPAN module, or maybe create your own, but don’t have the foggiest idea how to do it? Here are a few notes, tips, tricks, and links that might help you get started.

PAUSE id

While bringing awesome street cred, having a PAUSE id is strictly necessary only if you want to maintain or co-maintain a module. If you just want to contribute code, you’ll perfectly be able to do without, as it will usually be done via patches submitted to a bug tracking system, a code repository or using good ol’ email.

Becoming a co-maintainer

Becoming the co-maintainer of a module gives you the power to upload authorized releases of the modules on CPAN. To become one, the maintainer of the module simply has to promote you as such on PAUSE.

Creating a new module

You want to create your own module? Read the rest of this entry . . .

Perl Module Dependencies: how to require the latest, and nothing less

Recently, hanekomu was contemplating how to make subsequent installs of a Task::BeLike module upgrade its dependencies to their latest version.

The idea is intriguing. It’s not something you want to do for a typical module, but it makes sense in the context of Task::BeLike. If you care enough about a module to put it in your Task::BeLike, you probably care enough to want to upgrade when there’s a new version out there.

Alas, I think hanekomu’s proposed way of doing it is flawed (mind you, the debate is still going on as of the writing of this entry, and I can very well still be proven wrong). But after some pondeferous chin scratching, I might have come with a cunning alternative to it.

Read the rest of this entry . . .

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @FN_Press2: Schooner Information Technology Teams with Pythian to Deliver Advanced Support and High... http://finanznachrichten.de/20
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more



Social links powered by Ecreative Internet Marketing