use strict;
use warnings;
package Sscce;
use Getopt::Long;
use Pod::Usage;
my ($opt_help, $opt_man,
);
# sub main {
GetOptions(
'help' => \$opt_help,
'man' => \$opt_man,
) or pod2usage(-verbose => 1) && exit;
pod2usage(-verbose => 1) && exit if defined $opt_help;
pod2usage(-verbose => 2) && exit if defined $opt_man;
# }
1;
=pod
=head1 NAME
=head1 ARGUMENTS
=head1 OPTIONS
--help Brief manual
--man Full manual
####
X:\Data\Perl\NoFile>perl Sscce.pm -h
Arguments:
Options:
--help Brief manual
--man Full manual
X:\Data\Perl\NoFile>perl Sscce.pm -m
NAME
ARGUMENTS
OPTIONS
--help Brief manual
--man Full manual
####
X:\Data\Perl\NoFile>Perl -I. -MSscce -e"Sscce::main @ARGV" -- -h
Can't open -e: No such file or directory at Sscce.pm line 17.
####
X:\Data\Perl\NoFile>Perl -I. -MSscce -e"Sscce::main @ARGV" -- -h
Can't open -e: No such file or directory at Sscce.pm line 18 (#1)
(S inplace) The implicit opening of a file through use of the <>
filehandle, either implicitly under the -n or -p command-line
switches, or explicitly, failed for the indicated reason. Usually
this is because you don't have read permission for a file which
you named on the command line.
(F) You tried to call perl with the -e switch, but /dev/null (or
your operating system's equivalent) could not be opened.
Uncaught exception from user code:
Can't open -e: No such file or directory at Sscce.pm line 18.
Pod::Simple::parse_file(Pod::Usage=HASH(0x262f6a8), "-e") called at C:/Strawberry/perl/lib/Pod/Text.pm line 737
Pod::Text::parse_file(Pod::Usage=HASH(0x262f6a8), "-e") called at C:/Strawberry/perl/site/lib/Pod/Simple.pm line 535
Pod::Simple::parse_from_file(Pod::Usage=HASH(0x262f6a8), "-e", GLOB(0x2623f40)) called at C:/Strawberry/perl/lib/Pod/Text.pm line 706
Pod::Text::parse_from_file(Pod::Usage=HASH(0x262f6a8), "-e", GLOB(0x2623f40)) called at C:/Strawberry/perl/lib/Pod/Usage.pm line 179
Pod::Usage::pod2usage("-verbose", 1) called at Sscce.pm line 18
Sscce::main(GLOB(0x2623f40)) called at -e line 1