官方的文件库

从你的Perl的网站或应用程序生成安全的短链接。目前的版本是1.22..

CPAN

The library is available on CPAN.

下载

You can download the Perl library from CPAN or here.

代码

#!/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";

输出

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