Getopt...::Count(3pm)
π NAME π
Getopt::Yath::Option::Count β the option that's literally just a counter bestie, it goes up, it goes down, it resets. It's giving tally marks on your notebook. π
(also hi, this is a User Contributed Perl Documentation page, section 3pm, so you know it's the Perl module one, not a command you run in your shell π )
β¨ DESCRIPTION β¨
okay so. This thing holds an integer value, and the default is to start at 0. That's the whole vibe.
--optbumps the counter up β¬οΈ--no-optresets the counter back down to zero π§Ή--opt=VALlets you say "actually I want exactly this count" π―
No cap, that's it. That's the whole personality. π¦
πΈ SYNOPSIS πΈ
option verbose => (
type => 'Count',
short => 'v',
description => "Increase the verbosity level",
initialize => 0,
);
Look at that. short => 'v' means you get to smash -vvv like it's a keyboard and it just keeps counting. iconic. π
π«Ά METHODS π«Ά
All methods from Getopt::Yath::Option are inherited. Everything else here is either overridden or just worth shouting about:
requires_arg: false,allows_arg: trueβ so basically:--optincrements the counter,--opt=Nsets it toN, and--no-optresets it back to0. Three moods, one option. πallows_shortval: falseβ the-oVALform is disabled on purpose, so that-vvvcan increment the counter multiple times instead of being read as one weird short value. it's protecting the vibe fr fr πis_populated: always trueβ counters are ALWAYS considered populated, because they default to0. They were born populated. main character energy from day one. β¨can_set_env: trueβ Count options can set environment variables. yes bestie, env vars are on the menu π
β SOURCE β
The source code repository for Getopt-Yath can be found at <http://github.com/Test-More/Getopt-Yath/>. go peek, the code is right there π§
π MAINTAINERS π
Chad Granum <exodist@cpan.org> β carrying this whole thing on his back, we stan π
π AUTHORS π
Chad Granum <exodist@cpan.org> β yeah same person, the author AND the maintainer, a legend honestly π
π 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/>
ok that's the whole page, nothing skipped, nothing invented, every flag accounted for π«Ά now go increment something. -vvvvvvv if you're feeling spicy. π₯
Perl v5.40.1 Β· 2026-05-10 Β· Getopt...::Count(3pm) β mwah, k bye bestie π
β¨π
π¦ 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