App::Options

App::Options is Perl module combine command line options, environment vars, and option file values (for program configuration).
Download

App::Options Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Stephen Adkins
  • Publisher web site:
  • http://search.cpan.org/~spadkins/

App::Options Tags


App::Options Description

App::Options is Perl module combine command line options, environment vars, and option file values (for program configuration). App::Options is Perl module to combine command line options, environment vars, and option file values (for program configuration).SYNOPSIS #!/usr/local/bin/perluse App::Options; # reads option values into %App::options by default # do something with the options (in %App::options) use DBI; $dsn = "dbi:mysql:database=$App::options{dbname}"; $dbh = DBI->connect($dsn, $App::options{dbuser}, $App::options{dbpass}); ...Get help from the command line (assuming program is named "prog") ... prog -?Option values may be provided on the command line, in environment variables, and option files. (i.e. $ENV{APP_DBNAME} would set the value of %App::options{dbname} by default.)The "dbname" and other options could also be set in one of the following configuration files $HOME/.app/prog.conf $HOME/.app/app.conf $PROGDIR/prog.conf $PROGDIR/app.conf $PREFIX/etc/app/prog.conf $PREFIX/etc/app/app.conf /etc/app/app.conf with a file format like dbname = prod dbuser = scott dbpass = tigerSee below for a more detailed explanation of these and other advanced features.optionsApp::Options combines command-line arguments, environment variables, option files, and program defaults to produce a hash of option values. Requirements: · Perl


App::Options Related Software