A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

POD servers

You know, POD.
  • Pod::Simple::HTMLBatch - The best one. Properly marked up HTML, so fully customisable with CSS. Split into top-level directories. Doesn't do .t files, but can use a subclass of Pod::Simple::Search rigged to recognise .t files. Submitted patch.
  • Pod::Server - Basic default output, one single list. Docs lacking. What about CSS?
  • Pod::Webserver - Lots of dependencies, Catalyst, etc. GUI looks great. Couldn't get it to read from local dirs though.
  • Pod::POM::Web - Untested

How to download a gmail attachment on mobile

How to download a gmail attachment on your mobile:

  • Go to the gmail website on your mobile, the mobile version will load
  • Click the 'Basic HTML' link at the bottom
  • A download link will now be visible in your emails


Simple small Perl webservers

Quick start, if it's just a proof-of-concept and won't be running for long:

More complicated to set up, but much more robust:

Perl: Try::Tiny vs TryCatch vs Syntax::Feature::Try

From NAP::Policy (thanks dakkar):

       Using TryCatch you’d write:

         try { ... }
         catch (SomeClass $e) { use($e) }
         catch (SomethingElse $e) { use($e) }
         catch ($e) { use($e) }

       Using Try::Tiny you’d write:

         try { ... }
         catch {
          # here you get the exception in $_
          when (match_instance_of('SomeClass')) { use($_) }
          when (match_instance_of('SomethingElse')) { use($_) }
          default { use($_) }
         }; # note the semi-colon

       On the other hand, if your TryCatch use did not have a unqualified "catch ($e)", you need to write "default { die $_ }" to re-throw the unhandled exception (yes, you really have to write "die
       $_", read the documentation of die to learn the ugly details; "die" without arguments won’t do anything useful there).

       Also, keep in mind that the blocks used by Try::Tiny are actually anonymous subroutines, so they get their own @_ (nothing in the case of the "try" block, the exception in the case of the
       "catch" block), and "return" will return from the block, not the containing subroutine.


      Devel::Declare (via TryCatch) is deep scary voodoo.


From #backend:

  • Try::Tiny is the less magical and scary (and fragile) version of TryCatch
  • Syntax::Feature::Try is currently the least offensive of the alternatives, but it has quite a way to go
    • it does nasty things with the call stack
    • preferrably it would splice the optree, like a compiler macro
  • How does return work? TryCatch returns from the surrounding sub, Try::Tiny returns form the try {} block