Mike Friedman

  • Commented on Announcing Test::mongod
    Very cool! I can think of some good uses for this....
  • Posted MongoDB wants Perl programmers to Mike Friedman

    If you love Perl and are interested in MongoDB, we want to hire you. Feel free to drop me a line at if you're interested, or take a look at the official posting

  • Posted Floating Points Podcast: Perl and MongoDB to Mike Friedman

    I had the opportunity to sit down with some of the folks at Huffington Post to talk a little bit about Perl and MongoDB and my work as an engineer slash evangelist for the MongoDB community. It was a lot of fun and I enjoyed the experience immensely. You can listen to the podcast below or check…

  • Commented on Postfix Deref?
    I suppose one thing that's nice about it is that you can avoid curlies for dereferencing deep structures. e.g. the expression @{ $foo->{bar}{baz} } can become $foo->{bar}{baz}->@* assuming I understand it correctly. It does look weird, though. But we are...
  • Commented on JSON and alternatives and an extension proposal
    There's a JavaScript implementation of BSON in the Node.js MongoDB driver. You can find a browser-targeted build of it here....
  • Commented on Poor Mans Jobqueue for Catalyst Apps
    I've implemented this anti-pattern more times than I care to admit. I like Redis for maintaining ephemeral queues these days. Easy and dirt simple. As it happens, I have an old YAPC presentation about this exact topic. (Video, Slides)...
  • Commented on Three weeks of public talks coming up
    Here's the Meetup page for the New York City event on August 14th. Currently it's full but some people will probably cancel their RSVP before then. So add yourself to the waiting list if you want to come....
  • Commented on What's the difference between arrays and lists?
    You can modify the values in the array, but you're still not passing the actual array to the sub; @_ just has pointers to the list of SV *'s in the stack....
  • Commented on function return in scalar context
    The subroutine call puts @_ in scalar context, not the list returned by map. Consider perl -E '@foo = ( "bar" ); say ~~map { lc } @foo' 1 Same thing. You are lowercaseing the list ( 1 )....
  • Commented on The beauty of CSV
    Sometimes data don't need context or structure. No point in adding overhead by using an inappropriate tool for the job at hand. CSV is great. Except when it isn't....
  • Commented on Chicago.PM Planning a One-Day Perl Workshop - Interested?
    I'd be interested! I like Chicago - any excuse to go there for a day or two is a good one. :)...
  • Commented on What's the difference between arrays and lists?
    Jeffrey, thanks for the complement! Joel, that's a good example. I'll probably add it to the article tomorrow (it's late.) Thanks!...
  • Posted What's the difference between arrays and lists? to Mike Friedman

    One of the most common sources of confusion for new Perl programmers is the difference between arrays and lists. Although they sometimes look similar, they are very different things, and many bugs and misunderstandings are caused by not having a full understanding of the differences. Even…

  • Commented on A NuoDB Driver for Perl
    NuoDB looks like a really cool project. But if you want Perl programmers to use your driver, it has to be on CPAN. That's the only place 99% of us are ever going to look for Perl code. Plenty of...
  • Commented on Another strike against AUTOLOAD
    You might be able to do this more easily if you switched to Redis::Client (shameless plug.) No AUTOLOAD, and easier to extend....
  • Commented on Alien::Base - progress and problems
    Joel, I just want to say that I really appreciate your work on Alien::Base. I think it’s going to be one of the most important tools on CPAN in the near future and I’m glad someone has the brains to...
  • Commented on CPAN In The Sky With Diamonds
    Very nice!...
  • Commented on Is there a list of CERT advisories keyed to fixed Perl versions?
    Some of those CERT recommendations do list Perl::Critic modules under "Automated Detection." (This one, for example.) It would be pretty awesome to have a single policy bundle for all those recommendations, though. I'm feeling an itch in my coding fingers......
  • Posted Building Your First App with MongoDB and Perl at MongoDB Boston to Mike Friedman

    I'll be speaking on October 24th at MongoDB Boston 2012, taking place at the lovely Marriot Courtyard Tremont/Downtown.

  • Commented on A little “state” idiom
    Cool trick....
  • Posted MongoDB drops support for Perl 5.8. to Mike Friedman

    One of my many rules of software engineering, born of more than a decade seeing things done the Wrong Way, is that serialization must occur only at the extreme edges of your program. At all other points you should, if possible, deal only with structured data. The lack of it in one crucial area of…

  • Commented on Alien::Base Beta Release!
    Awesome! I’m really glad to hear that this is available. The CPAN toolchain has been missing this functionality for too long....
  • Commented on Beginning Perl (Wrox) is now released
    Congratulations, Ovid!...
  • Commented on Subroutine Signatures - my Plan (v.1)
    I think native subroutine signatures are a great idea, but I'm concerned about the effect of replacing the prototypes with a different feature, even if it's controlled by a lexical pragma, That means the thing after your sub name has...
  • Commented on Fast datetimes in MongoDB
    Time::Piece is definitely a possibility. The only difficult part is that the code that deserializes the returned datetime data from MongoDB is all written in C, so adding support for other date/time modules takes a bit of work. But if...
  • Posted Fast datetimes in MongoDB to Mike Friedman

    One of the most common complaints about the Perl MongoDB driver is that it tries to be a little too clever. In the current production release of (version 0.46.2 as of this writing), all datetime values retrieved by a query are automatically instantiated as DateTime objects.

  • Commented on Creating Your Own Perl
    This is very cool. I've been doing a similar kind of thing where I hacked up a custom Devel::Declare class to give me a custom class { ... } keyword that set up all my preferred syntax within the block....
  • Commented on Writing transactional functions
    What I mean is, instead of this: return [200, "File $path needs to be deleted", undef, {undo_actions=>[ [untrash=>{path=>$path}], ]}]; You could do something like this: return [200, "File $path needs to be deleted", undef, { undo_action => sub { $self->untrash(...
  • Commented on Writing transactional functions
    Have you thought about returning a function which is composed from all the undo steps, rather than a list of undo functions and arguments?...
  • Posted MongoDB 0.46.1 Released to Mike Friedman
    I'm happy to announce that version 0.46.1 of the Perl MongoDB driver has been released to CPAN! It should make its way to your local mirror soon. This release has mostly minor bugfixes and some housekeeping, but more and better stuff is coming down the line. I've written a detailed post about the…
Subscribe to feed Recent Actions from Mike Friedman

  • Shantanu Bhadoria commented on JSON and alternatives and an extension proposal

    There is actually a dirty way to send images over json, Just base64 encode the image and put it in the json object like so :

    perl -MMIME::Base64 -MFile::Slurp -E'say encode_base64 read_file "test.png"'

    and then decode using
    perl -MMIME::Base64 -MFile::Slurp -E'write_file("test.png",decode_base64("BASE 64 FOR IMAGE HERE"));'

    little know fact is that you can even embed base64 encoded images directly into your img tags in html like so(doesnt work in IE)
    img src="data:image/gif;base64,FVaSDQJmEV8V4VpWIR8J5YZuIQvNrYJ+GTvFwXpu. . . "/

  • Steven Haryanto commented on JSON and alternatives and an extension proposal

    Yup, I'm aware of that. And by encoding to, say, BSON or YAML, you can also support e.g. array of icons (array of binary data) or other fancy data structures.

    But at this point we're already double-encoding. Why not skip JSON and directly encode using a format that supports the features we want?

  • commented on JSON and alternatives and an extension proposal

    The problem of double-encoding is not the number of encodings but a lack of rigor and clean encodings on each level. JSON is pretty clean and rigor, so it makes more sense to defined another encoding on top of it (examples: JSON-LD or RDF/JSON) instead of hacking on the encoding level of JSON. So please don't waste effort to extend JSON but make use of it to defined your own encoding.

  • Toby Inkster commented on Postfix Deref?

    And four punctuation characters to dereference an array is an improvement over the current three?

    If I were to have my pick of features to add to core, then I'd choose autoboxing way ahead of this. Autoboxing would actually allow us to define a nice syntax for postfix dereferencing, along the lines of:

  • davewood commented on Poor Mans Jobqueue for Catalyst Apps

    reporting back

    need more processes now.

    david@nio:~/dev/myapp$ ./script/
    Found job: 25
    Found job: 25
    Found job: 25
    Processing test_id: 1355
    Processing test_id: 1355
    Processing test_id: 1355


    looking for a job queue now, currently checking out ZeroMQ

Subscribe to feed Responses to Comments from Mike Friedman

About is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.