#!/usr/bin/perl
use strict;
use warnings;
use Perl::MinimumVersion::Fast;

if (@ARGV) {
    for (@ARGV) {
        my $v = Perl::MinimumVersion::Fast->new($_);
        printf "%s: %s\n", $_, $v->minimum_version;
    }
} else {
    my $src = join("", <>);
    my $v = Perl::MinimumVersion::Fast->new($src);
    printf "%s: %s\n", $_, $v->minimum_version;
}

=pod

=encoding UTF-8

=head1 NAME

perlver-fast - Find a minimum required version of perl for Perl code

=head1 SYNOPSIS

  $ perlver-fast lib/App/Cme/Common.pm
  lib/App/Cme/Common.pm: 5.10

=head1 DESCRIPTION

C<perlver-fast> takes Perl source code and calculates the minimum
version of perl required to be able to run it.

This module supports only Perl 5.8.1+.

=head1 AUTHOR

C<perlver-fast> is written by tokuhirom E<lt>tokuhirom@gmail.comE<gt>.

This man page was written by Dominique Dumont for Debian project. It
can be reused for other projects.
