#!/usr/bin/perl -Iscripts

use CSS::Minifier 'minify';

foreach my $f (@ARGV) {
    unless(-e $f) {
        print STDERR "$f doesn't exists, skipping\n";
        next;
    }
    unless(-w $f) {
        print STDERR "$f is not writeable, skipping\n";
        next;
    }
    my $s='';
    open F, $f;
    $s = minify(input => *F);
    close F;
    open F, ">$f";
    print F $s;
    close F;
}
