Official library

Create safe short links from your Perl web site or application. The current version is 1.22.

CPAN

The library is available on CPAN.

Download

You can download the Perl library from CPAN or here.

Code

#!/usr/bin/perl -w
use strict;
use warnings;
use Carp;
use WWW::Shorten::Safe;
my $url = "http://www.example.com";
my $safe = WWW::Shorten::Safe->new();
$safe->shorten(URL => $url);
print "Short: ",  $safe->{safeurl}, "\n";
$safe->expand(URL => $safe->{safeurl});
print "Long: ", $safe->{longurl}, "\n";
my $info = $safe->info(URL => $url);
print "Clicks: ", $info->{clicks}, "\n";

Output

Short: http://safe.mn/d
Long: http://www.reviews-web-hosting.com/
Clicks: 185