Getopt...Scalar(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– Getopt::Yath::Option::Scalar β€” the manual page, but make it make sense

okay bestie, gather round, because we're reading Getopt::Yath::Option::Scalar(3pm) together and honestly? it's short, it's sweet, it's iconic. This is the bit of the Getopt::Yath family that handles your plain, ordinary, everyday scalar values. No cap.


✨ NAME ✨

Getopt::Yath::Option::Scalar β€” the option type for basic scalar values. that's it, that's the whole personality, and it serves πŸ’…


🌸 DESCRIPTION 🌸

So here's the tea: this option type takes a scalar value. And a value is required β€” like, you can't just rock up with nothing, that's not the vibe. 🫢

You can use it either way:

  • --opt VAL
  • --opt=val

And if you ever need to clear the value back out? --no-opt does that. Lowkey the cleanest delete button in the whole system. ✨


πŸŽ€ SYNOPSIS πŸŽ€

here's how you actually declare one, bestie:

option name => (
    short => 'n',
    type => 'Scalar',
    description => 'Specify the name',
    long_examples => [ ' foo'],
    short_examples => [ ' foo'],
    default => 'john',
);

look at that. short => 'n', a description, examples for both long and short forms, and a default => 'john'. it's giving very organized, very demure. πŸ¦‹


πŸ’… METHODS πŸ’…

Every single method from Getopt::Yath::Option is inherited. Yes, all of them. Nothing got left behind. But these next ones are either overridden or just plain noteworthy, so let's give them their moment:

  • requires_arg: true β€” a value MUST be provided, fr fr. Either --opt VALUE or --opt=VALUE, pick your fighter. No value, no entry. πŸ’€
  • can_set_env: true β€” scalar options can set environment variables. And yes, negated env vars are supported too β€” that's the "!VAR" form. πŸ‘‘

πŸ”₯ SOURCE πŸ”₯

The source code repository for Getopt-Yath lives at <http://github.com/Test-More/Getopt-Yath/>. go star it, it's the least you can do 🫢


🌈 MAINTAINERS 🌈

Chad Granum <exodist@cpan.org>

πŸ‘‘ AUTHORS πŸ‘‘

Chad Granum <exodist@cpan.org>

Copyright Chad Granum <exodist7@gmail.com>.

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

See <http://dev.perl.org/licenses/>


okay and now the cute sign-off: this whole page came to you via perl v5.40.1, dated 2026-05-10, and the manpage header called it Getopt...Scalar(3pm) because apparently even the manpage titles get truncated. tragic, honestly. anyway, go specify some scalars, bestie. periodt. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from