#!/usr/bin/perl # Get the latest version numbers of your favorite modules # (If they exist and have a normal version number...) # Usage: $0 Module::Name Other::Module Etc use strict; use warnings; use HTTP::Tiny; use JSON::PP 'decode_json'; use MetaCPAN::Client; my @ARGS = @ARGV ? @ARGV : ('MetaCPAN::Client','MCE','Plack'); my $http = HTTP::Tiny->new; for (@ARGS) { print "$_\t", decode_json($http->get( "http://fastapi.metacpan.org/v1/module/$_" )->{content})->{version},"\n" } my $cpan = MetaCPAN::Client->new; for (@ARGS){ printf "%s: %s\n", $_, $cpan->module($_)->version; }