From owner-freebsd-questions@FreeBSD.ORG Sun Apr 4 04:07:48 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799CA106564A for ; Sun, 4 Apr 2010 04:07:48 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id E35F08FC08 for ; Sun, 4 Apr 2010 04:07:45 +0000 (UTC) Received: from mail1.sourcehosting.net ([74.205.51.45] helo=v101.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NyH7b-000EE7-Fc; Sun, 04 Apr 2010 00:07:44 -0400 Message-ID: <4BB8108A.9080104@FreeBSD.org> Date: Sun, 04 Apr 2010 00:07:38 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Gary Kline References: <20100403210610.GA4135@thought.org> In-Reply-To: <20100403210610.GA4135@thought.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.6 (----) Cc: FreeBSD Mailing List Subject: Re: perl qstn... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 04:07:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gary Kline wrote: > guys, > > i'm finally trying to get my private scripts and binaries in > ~/bin in order. several of my perl scripts were meant to be > throwaway ... but a few seem to be more useful and i would have > to have informational or usage{} type messages. > > if a .pl script has to have at least one arg, is there an easy > way to do that? can i have a perl fn called usage() that would > be fed various strings? > > tia, > > gary > > > Hi Gary, Check out this Perl module that builds on Getopt::Long, but also includes support for echoing usage messages for each option: http://search.cpan.org/~rjbs/Getopt-Long-Descriptive-0.085/lib/Getopt/Long/Descriptive.pm Hope that helps, Greg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAku4EIoACgkQ0sRouByUApCXNgCgrLt1v3rV2+AjfxXMT1ew3GhE pZIAn0P5O7L5koQflkiQOuoTA+75POOe =Cyq4 -----END PGP SIGNATURE-----