#!/usr/bin/perl -w use strict; use warnings; use Getopt::Long; use Pod::Find qw(pod_where); use Pod::Usage; =head1 NAME Foo - Do something. =cut =head1 SYNOPSIS use strict; use Foo; my $f = Foo->new(); $f->doStuff(); =cut =head1 DESCRIPTION This class encapsulates stuff. =cut package Foo; =head2 new Constructor =cut sub new() { my ( $proto, %supplied ) = (@_); my $class = ref($proto) || $proto; my $self = {}; bless( $self, $class ); return $self; } =begin doc Do stuff =end doc =cut sub do_stuff() { } =head1 NAME My Script - Do something =cut =head1 SYNOPSIS Usage: $0 [options] options --help Show the help --man Show the manual. =cut =head1 DESCRIPTION This is the utility to do stuff .. It uses the Foo module internally. =cut package main; # # Configuration variables # my %CONFIG; # # Parse the command line. # exit if ( !Getopt::Long::GetOptions( # Help options "help", \$CONFIG{ 'help' }, "manual", \$CONFIG{ 'manual' }, ) ); Pod::Usage::pod2usage() if ( $CONFIG{ 'help' } ); Pod::Usage::pod2usage(-verbose => 2 ) if ( $CONFIG{ 'manual' } ); print "I am alive\n"; exit( 0 );