Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.080.784 Times

Getopt::Popt 0.02

  Date Added: August 21, 2010  |  Visits: 603

Getopt::Popt

Report Broken Link
Printer Friendly Version


Product Homepage
Download (88 downloads)



Getopt::Popt is a Perl interface to the popt(3) library. SYNOPSIS use Getopt::Popt qw(:all); # setup the options array push @options,new Getopt::Popt::Option( longName => "long", shortName => "l", argInfo => POPT_ARG_STRING, arg => $qux, val => $val); # or, if youre lazy, have Getopt::Popt automagically do the new() push @options, { shortName => s, argInfo => POPT_ARG_NONE, arg => $quux, val => s }; # "val"s can be a single character or an integer: push @options, { longName => xor, argInfo => POPT_ARG_VAL | POPT_ARGFLAG_XOR, arg => $quuux, val => 0xbadf00d # integer }, Enable automatic help/usage messages (--help or --usage): push @options, POPT_AUTOHELP; Create a new popt context: $popt = new Getopt::Popt(name => $alias_name, argv => @ARGV, options => @options, flags => $flags); Setup option aliases: # load some aliases $popt->readDefaultConfig(); $popt->readConfigFile("/path/to/aliases"); # add your own alias $alias = new Getopt::Popt::Alias(longName => "taco", argv => [qw(--flavored --kisses)]); $popt->addAlias($alias, $alias_flags); Load options as you would in C: # loop through the options, using the popt C way: while(($rc = $popt->getNextOpt()) > 0) { ... # one way to get the arg val $bork = $popt->getOptArg(); ... # stuff some args $popt->stuffArgs(qw(-q -u -x)); ... # start over $popt->resetContext(); ... } And handle errors as you would in C: $errstr = $popt->strerror($rc); $badopt = $popt->badOption($rc,$badopt_flags); Or try the new perly way: eval { while(defined($val = $popt->getNextOptChar())) { ^^^^-- note! # $val is a Scalar::Util::dualvar: if($val eq "c") { # <- character ... } elsif($val == 0xbeef) { # <- integer ... } elsif(ord($val) == 2922) { # <- utf8, ok! ... } ... # you can still stuff args or reset the context as before ... } }; # check for errors: if($@) { # prints something like "bad argument: --shoes: unknown option" print "bad argument: $@n"; } Get leftover args: $arg = $popt->peekArg(); $arg = $popt->getArg(); @args = $popt->getArgs();.

Requirements: No special requirements
Platforms: Linux
Keyword: Alias Arg Getoptpopt Libraries New Options Perl Programming Val
Users rating: 0/10

License: Freeware Size: 21.5 KB
USER REVIEWS
More Reviews or Write Review


GETOPT::POPT RELATED
Network & Internet  -  mod_perl 2.0.3
mod_perl project brings together the full power of the Perl programming language and the Apache HTTP server. You can use Perl to manage Apache, respond to requests for web pages and much more. mod_perl gives you a persistent Perl interpreter...
3.5 MB  
Libraries  -  Variable::Alias 0.01
Variable::Alias is a Perl module created to alias any variable to any other variable. SYNOPSIS use Variable::Alias alias; my $src; my $a; our $b; my @c; our @d; alias $src => $a; alias $a => $b; alias $b => $c[0]; alias @c => @d;...
3.07 KB  
Libraries  -  perl58delta 5.8.8
perl58delta Perl module contains information about what is new for perl v5.8.0. This document describes differences between the 5.6.0 release and the 5.8.0 release. Many of the bug fixes in 5.8.0 were already seen in the 5.6.1 maintenance...
12.2 MB  
Utilities  -  Perl OS 4
Perl OS is a program written in the Perl programming language combined with the Perl module Tk. Perl OS was created to make an easy interface to run Perl/Tk programs. It was also created to be an easy working environment complete with a text...
143.36 KB  
Programming  -  JOLIE 0.9.2
JOLIE is an interpreter for a new high level programming language, designed for SOAs (Service Oriented Architecture) orchestration (as, for example, WSBPEL by OASIS). The whole program is written entirely in Java to ensure cross-platform...
235.52 KB  
Programming  -  The Nice Programming Language 1.0
New object-oriented programming language based on Java, with the following advanced features: parametric types, anonymous functions, multi-methods, tuples, optional parameters.Nice also detects more errors during compilation (null pointers, casts).
1.29 MB  
Programming  -  Acme::BOPE 0.01
Created at the base of the hill of Babylon, New York, in full evening of funk, this module allows you to make inroads Perl programming using just jargon and language taken from the famous movie "Elite Squad" director Jose Padilha
10.24 KB  
Web Authoring  -  WebAPP 1.0 SE
WebAPP is a popular, open source Content Management System (cms) written in the Perl programming language. The name WebAPP is an abbreviation of Web Automated Perl Portal. Available under the GNU General Public License, WebAPP is free software....
2 KB  
Code Management Tools  -  X Language 0.7.1
X Language is a new multi-syntax programming including a portable set of APIs to create console or graphical applications runnable on many platforms (UNIX/X11, Win32, ...). X Language comes with an interpreter, a compiler and a debugger. X...
358.4 KB  
Graphics Viewers  -  FirmTools ShellExtension 2.0
This tool adds three new options to your right-click menu on a picture file: convert, print, and thumbnail preview. Converting supports most of the formats you will ever need: GIF, JPEG, BMP, PNG, TGA, PSD, TIFF, PCX, PCD, and more. The thumbnail...
520 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB