Introducing WWW::Pusher

WWW::Pusher ia a Perl module that gives you an interface to pusher.com.  I didn’t write the module, but it wasn’t on CPAN, so I just pushed it up to make it easier for everyone to find and install. 

Pusher is a web service that allows you to have real-time communication with remote clients from your app. 

[From my blog.]

How UAV::Pilot got Real Time Video, or: So, Would You Like to Write a Perl Media Player?

We don't usually do video decoding in Perl, but if you're not afraid of getting into xs and a little C code, it's all perfectly do-able. In fact, one of the reasons I wanted to take on the UAV::Pilot project is because I figured it would push me out of my comfort zone and force me to do things like this. C and xs are not as scary as people think they are, and they can open up things in Perl that are otherwise infeasible.

See my blog for the whole story.

NY Perlmongers Streaming

Followup to the previous entry ,
Streaming youtube link is here

PPW is just one week away.

The Pittsburgh Perl Workshop starts just 8 days from today. I've been sweating bullets for quite a while, but things are now falling into place. I'm even at the point where I've stopped worrying about the big things and can put some attention on the little bits of polish.

The talks are going to be awesome. We start out the event on Friday with John Anderson (genehack) teaching PPW's world-famous "From Zero to Perl." Then, Saturday starts out with a great talk from Mark Jason Dominus. We'll have a total of 15 different speakers covering a wide array of subjects. And of course, Geoff's famous lightning talks.

The food is going to be awesome. Breakfast, lunch, and snacks are all being covered. No need to run around town searching for something to eat. Instead, just relax and take in all the PPW goodness.

Building your own Moose

So you've switched to Moose a long time ago and you're quite happy with it, but you slowly notice that there are, well, things you wish it did differently. Fortunately, there's the MooseX:: namespace and now you have boilerplate you type at the beginning of every module.

use Moose;
use MooseX::StrictConstructor;
use MooseX::HasDefaults::RO;
use My::Moose::Types;

The above incantation says "die if there are unknown arguments to new(), and attributes should be read-only by default, and throw in my custom-defined Moose types as well".

But boilerplate is bad. In my quest to remove boilerplate, I've produced Test::Most and other modules, but in this case, there's not much to release because many people's Moose preferences will be different. Still, it would be much nicer to write use My::Moose; rather than continually repeating the lines above, so here's how to do that.

CPAN Testers Server Upgrade

Hi folks,

Sorry for the short notice, but the CPAN Testers Server will be getting an upgrade this weekend. This will start from Friday 27th September, and will continue over the weekend.

Further details on the blog - http://blog.cpantesters.org/diary/167

Please pass on to anyone you know who might be affected.

Cheers,
Barbie.

Streaming Tomorrow's NY Perl Mongers

SocialFlow is hosting tomorrow's NY Perl Mongers event, which starts at 6:30 Eastern ( NY time ).

Stevan Little will be speaking, the topic is:
"A new object system for the Perl 5 core"

We're going to make a best effort at streaming it live on youtube. We'll update the meetup.com page with the youtube link once we're live, and I'll post it on blogs.perl.org as well.

Afterwards, the video should stay online at the same link.

We'll be using Google's "Hangouts on Air" feature, which lets you broadcast a google hangout with a streaming youtube link.

Hope to see a bunch of you there!

Let's make a Perl Nerd Merit Badge

Somehow I ran across Nerd Merit Badges. They have a cool Stackoverflow badge and an octocat badge. I want a [animal redacted pending permission] Perl nerd merit badge to be part of their line up. We can easily make custom badges, so that's a good place to start.

Pledge to get a Perl Nerd Merit Badge

I've started a Crowdtilt campaign to collect money to make their minimum order and a little extra, even though we don't have the design yet (but we all know what it's going to be, right? :) I'll collect the money, make the order, receive the shipment, and send out the badges. You just need to pledge some money.

And, if someone with some design skills can follow their guidelines (and maybe talk to me), we can get that bit going. If you think you have something, send me your design and we'll let people vote. Or something. I don't know yet. We're JFDI right now. :)

YAPC::Asia Tokyo 2013: Fighting Legacy Code

Due to popular demand, I'm going to post a summary/transcript of my presentation for YAPC::Asia Tokyo 2013, titled "Fighting Legacy Code". It's also the presentation that I would've given if I didn't cancel my attendance for YAPC::NA Austin 2013.

Because I wrote all this in a rush, the language is very terse. Please let me know on twitter (@lestrrat) if somethings don't make sense.

You could also take a look at my Japanese slides while reading through this. You may get a little more feel for what I'm writing about.

Ouch 0.0408

Thanks to a patch by Graham Knop, Ouch now catches subclassed exceptions. How did I miss that? Thanks Graham. Also reformatted the Changes file according to the spec in CPAN::Changes::Spec thanks to sergeyromanov who is working on a quest to improve CPAN.

[From my blog.]

NET::LDAP Active Directory SID Unpack

I was searching high and low for a way to unpack what NET::LDAP was returning for an objectSID. When dumped, it was just a bunch of line noise garbage. Trying to figure out what format it was in I came across this:

Re: Getting Active Directory objectsid value using Net::LDAP - Help!

c. church says:

Looking on MSN, which describes the SID structure (urL :http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/sid_components.asp) it seems to say this:

the format of the sid is S-R-S-S...

Where the first byte is the revision level of the SID structure, the next 48bits (6 bytes) are the authority that issued the SID and then a variable number of (48bit?) subauthority values, as defined in Winnt.h

The Microsoft URL referred to above is dead. (Microsoft has no idea how to keep the antiquated, yet useful, documentation they produce alive, yet they manage to keep Windows XP kickin' for over a decade. Go figure.)

I translate "Understand Perl Scope" from Japanese to English

I translate "Understand Perl Scope" from Japanese to English

Understand Perl ScopeUnderstand Perl Scope

Perl scope concept is very good. This is more understandable than other language.

YAPC::Asia Tokyo 2013 is over

So I just came back from the staff after party. I'm exhausted. So I'll only write the important stuff:

  • This year, we had 1,131 attendees (ticket sales, invited guests, speakers, staff) I'm pretty sure this is THE BIGGEST YAPC EVAH
  • Talks on 4-tracks
  • We provided Wi-Fi to all the attendees via custom built network, and we saturated a 100Mbps line when our attendees started downloading iOS7 simultaneously
  • This is the LAST YAPC::Asia Tokyo that 941-san, and myself will do. There are no plans to host another YAPC::Asia Tokyo next year, unless someone steps up to take up the challenge.
  • I was involved in all of the 8 YAPC::Asia Tokyo's previously held. I had a wonderful ride. It was pleasure, but it's time to move on

Videos, photo footage, and blogs will be posted soon-ish. Stay tuned.

Payment Gateways

At Plain Black we’ve used iTransact for years to build our ecommerce apps. It’s fast, stable, and has good rates. I even built a Perl wrapper for it. But lately we’re wanting to do stuff it either doesn’t do or doesn’t do well like payouts to customers and recurring transactions. iTransact has recurring transactions, and we use it, but the interface is clunky.

Anyway we started investigating a few more modern interfaces:

- Stripe
- Balanced Payments
- Braintree

The best of the bunch appears to be Braintree. And even better, they’ve already got a Perl wrapper for us.

[From my blog.]

A New Catalyst Sitemap Generator --

I've just published a new Catalyst plugin to CPAN and would love to get some feedback on it before I increment the version to the magical 1.0 and declare it production-worthy (sometime next week).

As it stands, there's already an existing sitemap plugin written a few years ago, that works quite well, but I ran into the problem for a client where they have close to 40 million public URLs and want that all represented in a sitemap.

Sitemaps are limited to 50,000 URLs, but through use of a Sitemap Index file, you can include up to 50,000 sitemaps, each with 50,000 URLs.

Rather than just write a one-off script, I decided to write this as a Catalyst plugin and publish to CPAN under the name of Catalyst::Plugin::BigSitemap. It has a public interface that matches the original sitemap plugin (so it can be used as a compete, drop in replacement).

What's supported.

I translated "Create Subroutine" from Japanese to English.

I translated "Create Subroutine" from Japanese to English.

Create Subroutine

I describe the way to use subroutine in this topic for Perl beginners. Perl subroutine is fun. If you master the way to create subroutine, you can write more readable code.

What if Perl OO was a Core Feature?

Over on Reddit /r/perl, there's a rather blatant troll complaining about the lack of OO as a core feature in Perl. The tone there is clearly not constructive and not worth responding further, but I feel compelled to answer a question: what would be improved if OO was a core feature, rather than built out of existing components of the language?

Personally, I think the fact that OO can be built this way is a demonstration of flexibility. It also allows you to build your own OO system that suits your needs. If the standard kind of blessed data structure doesn't work for you, try Inside-Out Objects. This also had hidden benefits later on; when roles/traits/mixins became all the rage, Perl just added them via CPAN modules. There was no long, drawn out, design-by-committee bikeshedding discussion like there was for Java.

If you really wanted to, you could even build an object system without bless() or packages. The constructor would return a hash, which is filled with sub references:

Quick update

Just a quick update for anyone who's wondering what's going on with me. I had a few major projects at work that absorbed a ton of what I thought would be free time. So far, we have:
  1. Migrated from physical Sendmail Sentrion server to virtual
  2. Moved Enterprise Email Services from one Data Center to a Dual Data Center
  3. Migrated our custom Perl environment along the same path
  4. Consolidated codebase from ~3,000 custom applications to ~28 (Thanks, Mojolicious!)
  5. Significantly rewrote applications to centralize and normalize Directory (LDAP/AD) functions
  6. Consolidated dependent modules to a more uniform selection

There's plenty more work to do as well - I'm having to post-facto implement testing (unit/regression) that should have been in place years ago. Thanks to Test::Mojo, that's become not only feasible but fun. I'm also working on getting our deployment strategy modernized. Git/Perl/Mojolicious are an amazing combo for this.

With some of the major milestones of the year out of the way, I'm expecting to be able to get more stuff out on Github for others to play with.

Devel::Confess - Include stack traces with all errors/warnings

Edit: Since writing this, I've decided on a proper name. Devel::Confess is the name for this module going forward. Carp::Always::EvenObjects exists now only as a wrapper around Devel::Confess.

Carp::Always is a very useful module that will force all errors and warnings to include a full stack trace to help with debugging. However, it has some limitations. If an exception object is thrown rather than a string, the stack trace can't simply be appended to it. die, Carp, and Carp::Always just pass the object through unmodified. Some exception systems include stack traces in their objects, but for those that don't, this hurts the ability to debug. As more libraries use exception objects, this becomes more problematic (e.g. autodie).

p5-mop Inside-Out object problem

Now, p5-mop-redux is implemented by Inside-Out object.

p5-mop is not using the standard scheme where an object is simply a blessed structure (usually a HashRef). Instead, it’s using InsideOut objects, where all you get as an object is some kind of identification number (usually a simple reference), which is used internally to retrieve the object properties, only accessible from within the class. (p5-mop: a gentle introduction)

Inside-Out object hidde attribute values from out of object. Is it good?

Inside-Out object has big inconvenient feature. that is we can't see attribute values by Data::Dumper.

In hash-based object, we can see attribute values by Data::Dumper;

    use Data::Dumper;
    print Dumper $obj;

But Inside-Out object is not.

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.