BTW, if using Getopt::Long why not also Pod::Usage?

Built-in documentation, e.g../acme.pl --help or perldoc acmel.pl. Easy to use and very handy (I'm reseller ;-)).

#!/usr/bin/perl use warnings; use strict; use Getopt::Long; use Pod::Usage; my %options; Getopt::Long::Configure("no_ignore_case"); GetOptions(\%options, "help", "foo=s","bar=s",); pod2usage( -exitstatus => 0, -verbose => 2 ) if $options{help}; foreach my $option (%options ) { pod2usage( -exitstatus => 2, -verbose => 1 ) unless $option; } # ...the rest. __END__ =pod =head1 NAME acme.pl =head1 SYNOPSIS Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonu +my eirmod tempor invidunt ut labore et dolore magna aliquyam erat, se +d diam voluptua. acme.pl [options] =head1 OPTIONS =over 8 =item B<-h --help> Print a brief help message and exit. =item B<-f, --foo> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse m +olestie consequat, vel illum dolore eu feugiat nulla facilisis. Manda +tory. =item B<-b, --bar> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper s +uscipit lobortis nisl ut aliquip ex ea commodo consequat. Mandatory. =back =head1 DESCRIPTION At vero eos et accusam et justo duo dolores et ea rebum. Stet clita ka +sd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam no +numy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. At vero eos et accusam et justo duo dolores et ea +rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem i +psum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscin +g elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore m +agna aliquyam erat, sed diam voluptua. At vero eos et accusam et just +o duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata + sanctus est Lorem ipsum dolor sit amet. =head1 EXAMPLE ./acme.pl --foo nose --bar cuke =head1 BUGS None. =head1 AUTHOR Karl Goethebier <karl.goethebier@snakeoil.com> =head1 COPYRIGHT (C) 2013 Snakeoil Ltd. =cut

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


In reply to Re: Feedback on my second script by karlgoethebier
in thread Feedback on my second script by Jackiejarvis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.