The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

opts - proof of concept

SYNOPSIS

  # in script.pl
  use opts;
  sub run {
    opts my $p => 'Int';
  }
  run();

  ./script.pl --p=4 # p => 4

  # in script.pl
  sub run {
    opts my $p => { 'Int', required => 1 },
         my $q => 'Int';
  }
  ./script.pl --p=3 --q=4 # p => 3, q => 4
  ./script.pl --p=4       # p => 4, q => undef

  # in script.pl
  sub run {
    opts my $p => {isa => 'Int', default => 3},
  }
  ./script.pl --p=4       # p => 4
  ./script.pl             # p => 3

DESCRIPTION

opts is DSL for command line option.

AUTHOR

Kan Fushihara <kan.fushihara at gmail.com>

SEE ALSO

http://github.com/tokuhirom/p5-args, Getopt::Long

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.