MouseX...::Basic(3pm)

πŸ“¦
version 0.38 Β· 4 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

🌸 NAME 🌸

MouseX::Getopt::Basic β€” the role that gives you Getopt::Long functionality, bestie πŸ’–

It's filed under the manual name MouseX...::Basic(3pm), in case you were squinting at your terminal wondering where you landed. You're in the right place, don't worry 🫢


✨ SYNOPSIS ✨

okay so here's the whole vibe, copy-paste ready:

## In your class
package My::App;
use Mouse;

with 'MouseX::Getopt::Basic';

has 'out' => (is => 'rw', isa => 'Str', required => 1);
has 'in'  => (is => 'rw', isa => 'Str', required => 1);

# ... rest of the class here

## in your script
#!/usr/bin/perl

use My::App;

my $app = My::App->new_with_options();
# ... rest of the script here

## on the command line
% perl my_app_script.pl --in file.input --out file.dump

like. it literally just works. you consume the role, you declare your attributes, you call new_with_options(), and your flags are right there on the command line. no cap πŸ”₯


πŸ’… DESCRIPTION πŸ’…

This one is like MouseX::Getopt and you can absolutely use it instead of it β€” the one tiny difference is that it does not make use of Getopt::Long::Descriptive (or "GLD" for short). that's it. that's the whole personality 🌈

🌟 new_with_options 🌟

See "new_with_options" in MouseX::Getopt. yeah bestie, the details live over there β€” go peek πŸ‘€


and that's the whole page, fr fr πŸŽ€ this doc ships with perl v5.32.1, dated 2021-09-16, and it's the MouseX...::Basic(3pm) page from the User Contributed Perl Documentation collection. mwah, go write something iconic πŸ’œβœ¨

πŸ“¦ where this page comes from