Search notes:

Perl module Getopt::Lucid

#
#   ./script.pl --opt_A foo --opt_C X --opt_D Y --OPT_F fff --help
#
use warnings;
use strict;
use feature 'say';
use Config::Std;
use File::Basename;

use Getopt::Lucid qw(:all);


my $opt = Getopt::Lucid->getopt([

  Param ( 'opt_A' ),
  Param ( 'opt_B' ) -> default  ('val_B'  ),
  Param ( 'opt_C' ) -> needs    ('opt_D'  ),   # dependencies
  Param ( 'opt_D' ),
  Param ( 'opt_E' ) -> valid    (qr/^\d+$/),   # must be number
  Param ( 'opt_F' ) -> anycase,                # case insensitiv
  Switch( 'help'  )

]);

read_config(dirname($0) . '/script_config.ini' => my %cfg);
$opt->merge_defaults ($cfg{''});

$opt->validate( { 'requires' => ['opt_A'] } );

say $opt->get_opt_A;
say $opt->get_opt_B;
say $opt->get_opt_C;
say $opt->get_opt_D;
say $opt->get_opt_E;
say $opt->get_opt_F;
say $opt->get_help;

Github repository PerlModules, path: /Getopt/Lucid/script.pl

See also

Getopt::Long
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1744800574, '18.226.93.94', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/Getopt/Lucid/index(77): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78