We've created a Google Polygon Encoding Algorithm in Perl released under GPL. This routine was ported from Mark McClure's work located at: http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
There is a slight difference to our routine, the choices as to which points to drop at certain zooms was made using the Douglas-Peucker routine instead of the distance method employed by the original routine. This allows the polygon to maintain its shape better at the lower zooms plus allows specifying the tolerance in meters instead of radians. The performance of our routine is less due to the additional math from the Haversine formula embedded in our D-P, but this is offset by the easier to understand code that was produced.
We are open to suggestions on how this routine can be improved, so please send any suggestions our way.
USNaviguide_Google_Encode.pm - A Perl module