PSGI Archives

A Simple Plack/DBI Example

In A Simple Mojolicious/DBI Example Joel Berger demonstrates how to build a very simple CRUD web app (well, a CR one anyway) using Mojolicious and DBI. I was impressed at how concise it was, and wondered how my preferred technology stack would compare.

I'm not a fan of template languages, preferring DOM manipulation. And rather than Mojo, I'm using Plack here. Anyway, this is what I came up with...

Be Your Own Big Brother

Many modern browsers (including recent versions of Firefox and Opera) support the W3C's geolocation API. This is a standardised mechanism for Javascript to ask your browser where it geographically is in the world. Typically the browser will then pop up a message asking you if you wish to reveal this information, giving you the opportunity to opt out.

But how does your browser know where it is? The method that Firefox and Opera both seem to use is this:

  1. They sniff data o…

About Toby Inkster

user-pic I'm tobyink on CPAN, IRC and PerlMonks.