#!/usr/bin/perl

use Acme::Minify qw(minify);

use warnings;
use strict;

=head1 NAME

plminify - Perl code minifier

=head1 VERSION

version 0.07

=head1 SYNOPSIS

Minify Perl code from command line

  plminify FILE [> OUTPUT]

=cut

my $err = "ERROR: Enter a valid file name.\n";

die $err unless $ARGV[0];

open(FILE, $ARGV[0]) or die $err;
my $data = join('', <FILE>);
close FILE;

print minify($data)."\n";

=head1 AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

=head1 LICENSE AND COPYRIGHT

Copyright 2010 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

=cut