Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > 5c47486c685d04d0d4cc429671ce5385 > files > 6

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 $chunks = $snoop->comments($ARGV[0]);

if($chunks) {
    print "$_\n" for @$chunks;
} else {
    print "$ARGV[0]: No comments found\n";
}