#!/usr/bin/perl -w # My Perl Application # $Id$ # --- # $Log$ use Getopt::Long; use Pod::Usage; # recommended to use together with Getopt use strict; use vars qw($VERSION); $VERSION = sprintf( '%d.%02d', q$Revision$ =~ /(\d+)\.(\d+)/ ); # Parse command line arguments and assign corresponding variables # Arguments can be put into hash, array of scalar GetOptions ( 'i|in=s' => \( my @file_in = () ), 'o|out=s' => \( my $file_out = undef ), 'define=s' => \( my %defines = () ), 'verbose' => \( my $verbose = 0 ), 'version' => sub { die "$VERSION" }, 'quiet' => sub { $verbose = 0 } ); unless ( $#file_in > 0 && defined $file_out ) { pod2usage( -exitval => 1, -output => \*STDERR ); } # Beginning of application code .... __END__ =pod =head1 NAME application.pl =head1 SYNOPSIS application.pl [options] =head1 ARGUMENTS Arguments to this script are mandatory. =over 4 =item B<-i|--in [file]> Specify an input data file for report extraction. =item B<-o|--out [file]> Specify the output file name for the report. =back =cut #### @output_files = split /,/, $file_out;