Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > 5c47486c685d04d0d4cc429671ce5385 > files > 5

perl-File-Comments-0.07-5.fc13.noarch.rpm

#!/usr/bin/perl -w
###########################################
# check-type
# Mike Schilli, 2005 (m@perlmeister.com)
###########################################
use strict;

use File::Comments;
use Log::Log4perl qw(:easy);
use Getopt::Std;

die "usage: $0 file" unless @ARGV;

getopts("v", \my %opts);

Log::Log4perl->easy_init(
{level => $opts{v} ? $DEBUG : $ERROR, 
 layout => "%F{1} %L %m%n"});

my $snoop = File::Comments->new();

my $type = $snoop->guess_type($ARGV[0]);

if($type) {
    print "$ARGV[0]: $type\n";
} else {
    print "$ARGV[0]: UNKNOWN\n";
}