Getopt...::Count(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– 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.

  • --opt bumps the counter up ⬆️
  • --no-opt resets the counter back down to zero 🧹
  • --opt=VAL lets 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: --opt increments the counter, --opt=N sets it to N, and --no-opt resets it back to 0. Three moods, one option. πŸ’…
  • allows_shortval: false β€” the -oVAL form is disabled on purpose, so that -vvv can 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 to 0. 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 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