Getopt...Scalar(3pm)
π 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 VALUEor--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 π
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
- ubuntu stonking: libgetopt-yath-perl 2.000011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms