Acme we are not just 500 Pound Anvils

Well I finally did learned something interesting looking at an Acme modules today.

I spotted Acme::Curse and at first glance it seemed to be just another of those silly play things in this namespace.

However the POD entry intrigued me.

Did you ever want to droo the blessing of an object? Well, now you can: Acme::Curse unblesses reference by returning a shallow, non-blessed copy of the object.

Well I do not know hot to 'droo' something (sounds painful) but the idea of a non-blessed copy is something I have need of.

So I looked inside and I saw this

Things we don't have #2

About this posting series. Previous episodes: #1.

This time we're going to look at virtual filesystems. Perl currently seems to lack in this area compared to some other languages. There are no support for accessing or creating the various VFS's out there from Perl, except for Fuse.

First, KDE's KIO (KIO slaves). There are many slaves available, from accessing devices like Camera and Bluetooh, to the usual network protocols (HTTP, FTP, WebDAV, IMAP), to various settings and applications. One can create a KIO slave from, say Python and Ruby, but currently we lack a library to do so, even for accessing resources using KIO. The KDE4 Perl bindings project seems to lag or stop.

Second, the GNOME project's GVFS/GIO library. Perl does have a couple of libraries (VFS::Gnome, Gnome2::VFS) for the older GNOME VFS though.

Never Be Afraid To Change Your Design

A few years ago I wrote a little video game in Perl called Lacuna Expanse. Tens of thousands of people have played it, and while I wouldn’t call it a raging success, it has paid for itself and continues to make a modest profit. That said, it wouldn’t have if I hadn’t been willing to make drastic changes to the design of it way late in its development. 

For the first 3 months of its development, Lacuna was storing it’s data in Amazon’s Simple Storage Service. When I had trouble getting that to scale I switched it over to MySQL. Three months into a 12 month development cycle is far, but not that far, for a major change.

About six months into the development cycle we decided to entirely change how space was configured. It was originally modeled in 3D space and the user would be able to see a slice of it at a time.

Off-topic: We still have to put up with name calling?

No, not Perl, but open source developers in general. It seems that FusionCharts is openly mocking open source developers on their front page, but use open source extensively.

YAMADDP (Yet Another Moose ADD Post)

Well there is always more things to post on and today I found yet another.
You might remember this post where I was setting starting money for player characters and you might remember this post where I pinched the idea from.

There was a flaw with this as it is true I was not longer able to set starting gold or hit points by doing something this


 return $self->current_gp()
          if ($self->current_gp());

or

So you'd like to ... do offline development and testing

[This post will be imported to cpanlists.org once the service is ready]

Do you want to develop your Perl project on your PC or laptop, without having to be constantly connected to the Internet? Then follow this simple guide.

Creating a CPAN mirror

First you'll want an offline CPAN mirror, where most of the useful Perl modules reside. There is already a document explaining how to do this, so go read it. At the time of this writing (Feb 2014), a full CPAN mirror stands at +- 16GB. Chances are you don't need a full mirror, but a mini one, which contains only the latest version of each module and currently stands at about 2.5GB. You can then update your offline mirror every so often (I do this about once a week).

Next, you'll also want App::cpanminus, if you don't already have it. This CPAN client makes it easy to install from an offline CPAN or DarkPAN mirror.

Now to install a module from your local mirror, you can simply do:

% cpanm --mirror /path/to/your/cpan --mirror-only Module::Name

Perl and Me, Part 11: Please Mr. Perl, Will You DWIM?

This is part 11 of an ongoing series where I explore my relationship with Perl.  You may wish to begin at the beginning.

This week we look at trade-offs in expressivity.

Last week I told a story about a CS professor who was inexplicably afraid of recursion.  Other than the obvious moral of “don’t be afraid of things that use underlying complexity to make your external code simpler,”1 what exactly does this have to do with Perl?

Timm Murray made this recording of my Stupid CPAN Tricks talk at...



Timm Murray made this recording of my Stupid CPAN Tricks talk at MadMongers. He thinks he may record all MadMongers talks going forward.

[From my blog.]

Life is good

Well you might remember the few post I did on my little pet mod Orignal and how its tests where broken how I fixed that and made it more broken!

But now the good news it I 100% Green well I known I am not going to win any prize for this module as a matter of fact the only review pan it. Hey but at least people are looking at it

Anyway it is what it is. A simple way to get accessors that worked for me in a very restricted development environment and I though it might help some-one else and really every ones should have at least one mod on CPAN they wrote themselves from scratch..

Funny I also like to look at it every once and a while on the CPAN MAP but I doubt it will ever make the top 100 there? Btw the way I find this a much faster way to search on CPAN and most likely the only good thing you will take away from this post.

Still no-one has gotten the joke behind the name that I do find funny.

Reflecting on the DFW.pm winter hackathon competion

I know it has been a while, but I’m finally getting around to posting my reflections on the Dallas-Ft. Worth Perl Mongers Winter Hackathon. Better late than never right? I will talk about my solution, but I also want to comment on the hackathon itself, which I thought was an excellent bit of fun.

Next DBD::SQLite to be released in early March

DBD::SQLite 1.41_06 is a release candidate of the next production release of DBD::SQLite. I'm planning to release it around the QA Hackathon in March if there's no blocking report. I suppose upgrading won't break your software, but please test it with 1.41_06 and post anything new you find to RT/GitHub/Mailing List.

Here're notable changes since the last stable release:

  • SQLite's query planner has been rewritten since SQLite 3.8.0 (bundled in DBD::SQLite 1.41_01). According to the upstream author, the new query planner should give exactly the same result (though perhaps with a little less CPU time spent planning) for simple queries, and for complex queries, it can in many cases provide a much faster answer.
  • DBD::SQLite now supports URI filenames to control read/write mode and/or shared cache mode.
  • DBD::SQLite now respects explicit data type specification of bind values (via bind_param() etc) even if "sqlite_see_if_its_a_number" handle attribute is set to true.

Seeking 3d graphics lib for JS

My client especially wishes to display clustered stacked bar charts with and without a 3d effect, via JS.

I do realize the 'clustered stacked' and '3d' requirements are both very limiting.

AFAIK the d3 package has no 3d option, but is otherwise fascinating.

JS libs I know of are:

o JSPowered. It's a commercial product, very nice, and is called via their PHP programs. It even supports clustered stacked bar charts, making it special in that way. Currently this seems to be the only option.

o InfoVis. It looks nice, but has no 3d effect available, not clustered stacked, apparently.

This summary is rather impressive, but does not mention 3d.

Is 10% really mean perl is Dead??

Looking at any number of differing sites that rate programming languages it is clear that since the early 2000s perl started a decline but has be happily chugging along at anywhere from 7.5% to 10% depending on which site you look at.

The TIOBE index is one as is langpop and they have their way to create their results. Mostly they look at github, Stack Overflow and Google searches.

Somehow F# is trending upward. But is it because its is better or is it because it is new and people are looking for answers on it and checking in many new modules into Github?

I think Tim Bunce has long since debunked the myth of the death of perl and if you have seen this presentation it is well worth your time as his point his point is quite clear, Perl is a mature language that attracts a higher quality of developer.

Xerces-C++ for Validating Against Multiple Schemas

Xerces-C++ is Apache's C++ implementation of the Xerces XML parser. It turns out that it ships with a simple example program, stdinparse, that can validate your XML (which many tools do) against multiple schemas simultaneously (which few Open Source tools do).

A sample command line could be:

$ ./stdinparse -n -s < /tmp/10.5072__FK250925-xerces.xml

Running a non-blocking command in Mojolicious

Mojolicious is an awesome framework designed from the ground up to be non-blocking. During web development it is sometimes desirable to run a command and do something with the results. However, with methods such as "system" and "open" the command will block concurrent requests.

A non-blocking process execution is possible with background processes; however, the process must be managed and if the UserAgent needs updating, then long-polling will need to be utilized.

Below is a complete Mojolicious::Lite program that does this. In words, the app generates a utility script on-the-fly that a) sleeps; b) writes to a state file; and c) sleeps at the the end. This means that our state file will be around while the program is running. This mimics several use-cases, for example creating a thumbnail.

The state file can be inspected using events provided by Mojo::IOLoop::ProcBackground. The alive event is a heartbeat for the process and the dead event happens when the process stops.

Stupid CPAN Tricks

Stupid CPAN Tricks :

I’ve uploaded my slides for 9 Perl modules you should have in your tool belt to the MadMongers file archive.

[From my blog.]

The Road to Hell is Paved With Good Intentions

Ok you might remember this post a week or so ago. Our might even remember the last line

one more quick fix and then they all pass, package and stick on CPAN.

Famous last words of the dammed as I took a look today and

Easy Fixtures With DBIx::Class

As part of my rewriting of my testing classes (tired of hearing about it yet?), I found myself at the part where I needed to explain test fixtures. A fixture, in this context, is simply a particular known state that you can test against. In particular, I'm focusing on using database fixtures in tests. There's not a lot of good discussion about this and that's unfortunate because fixtures can really benefit your test suite.

Add your gittip id to your MetaCPAN account

  • In the Account menu (top right) on MetaCPAN, select Profile.
  • Scroll down to the Profiles section and select Gittip from the "Add Profile" drop-down.
  • Fill in your gittip id and click on the word "check" to the right.
  • Scroll down and hit "Save Profile"

And don't forget to join the Perl community on gittip!

POE::Session object_states: handlers are sub names not CODEREFs

This works as expected:

    sub _poll_start {
        my $self = $_[OBJECT];
    [...]
    POE::Session->create(
        'object_states' => [
            $self => {
                '_start' => '_poll_start',
                'Work'   => '_poll_work',
                '_stop'  => '_poll_stop',
            }
        ],
    );

This, on the other hand, calls the handlers but without filling the @_ array:

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.