GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Getopt::EX::Long(3) User Contributed Perl Documentation Getopt::EX::Long(3)

Getopt::EX::Long - Getopt::Long compatible glue module

  use Getopt::EX::Long;
  ExConfigure(...)

  or

  require Getopt::EX::Long;
  my $parser = new Getopt::EX::Long::Parser
        config   => [ Getopt::Long option ... ],
        exconfig => [ Getopt::EX::Long option ...];

Getopt::EX::Long is almost compatible to Getopt::Long and you can just replace module declaration and it should work just same as before.

Besides working same, user can define their own option aliases and write dynamically loaded extension module. If the command name is example,

    ~/.examplerc

file is loaded by default. In this rc file, user can define their own option with macro processing. This is useful when the command takes complicated arguments.

Also, special command option preceded by -M is taken and corresponding perl module is loaded. Module is assumed under the specific base class. For example,

    % example -Mfoo

will load "App::example::foo" module, by default.

This module is normal perl module, so user can write any kind of program. If the module is specified with initial function call, it is called at the beginning of command execution. Suppose that the module foo is specified like this:

    % example -Mfoo::bar(buz=100) ...

Then, after the module foo is loaded, function bar is called with the parameter baz which has value 100.

If the module includes "__DATA__" section, it is interpreted just same as rc file. So you can define arbitrary option there. Combined with startup function call described above, it is possible to control module behavior by user defined option.

Config options are set by Getopt::ExConfigure or exconfig parameter for Getopt::EX::Long::Parser::new method.
AUTO_DEFAULT
Config option RCFILE and BASECLASS are automatically set based on the name of command executable. If you don't want this behavior, set AUTO_DEFAULT to 0.

Other options including RCFILE and BASECLASS are passed to Getopt::EX::Loader. Read its document for detail.

Subroutine GetOptionsFromString is not supported.

Variables $REQUIRE_ORDER, $PERMUTE, $RETURN_IN_ORDER can not be exported.

Getopt::EX
2019-09-03 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.