Getopt...::List(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

✨ Getopt::Yath::Option::List β€” Options that can take multiple values πŸ’…

okay bestie, settle in, because this is the Getopt...::List(3pm) page from the User Contributed Perl Documentation, and it's literally about options that can hold multiple values at once. group-chat energy, but make it command line. πŸŽ€


🌸 NAME 🌸

Getopt::Yath::Option::List β€” Options that can take multiple values. slay.


🌈 DESCRIPTION 🌈

So here's the tea πŸ“: this thing can take multiple values. Every time you hit it with --opt VAL, it just appends a value onto the list. Casual. Effortless. Iconic.

--no-opt will empty the list entirely β€” like, poof, gone, no trace, main character exit. πŸ’€

And if a split_on parameter is provided, then a single use can set multiple values at once. For example, if split_on is set to , and you do --opt foo,bar, then both foo and bar get added to the list. one command, two values, we love efficiency. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

option copy_env => (
    short => 'e',
    type => 'List',
    description => "Specify environment variables to pass along with their current values",
    long_examples => [ ' HOME', ' SHELL' ],
    short_examples => [ ' HOME', ' SHELL' ],
);

look at her. she's doing so much. πŸ‘‘


πŸ’– METHODS πŸ’–

Every single method from Getopt::Yath::Option is inherited β€” you get all of it for free, no cap. The ones below are the overridden or otherwise noteworthy girlies:

  • requires_arg: true
  • allows_list: true β€” Each use of --opt VAL appends to the list. --no-opt empties it. literally the whole personality.
  • normalize_value(@input) β€” If the input looks like a JSON array (e.g., '["a","b"]'), it is decoded and the elements are returned. And if split_on is set? Values are split on that delimiter before normalization, bestie. order matters. 🧚
  • get_initial_value β€” Checks from_env_vars for initial values. And unlike the base class, multiple environment variables can each contribute a value β€” every env var pulls its weight. Returns an empty arrayref if no environment values are found. 🫢

πŸŽ€ ADDITIONAL ATTRIBUTES πŸŽ€

  • split_on => $delimiter β€” A string or regex to split values on. For example, with split_on => ',', then --opt foo,bar adds both foo and bar to the list. one flag, two entries, no notes. 🌟

πŸ”₯ SOURCE πŸ”₯

The source code repository for Getopt-Yath can be found at http://github.com/Test-More/Getopt-Yath/ β€” go be nosy, she's open source. πŸ’œ


πŸ‘‘ 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/


This was perl v5.40.1, documented on 2026-05-10, and that's the whole Getopt...::List(3pm) page babes β€” read it, love it, go append to a list responsibly. bye bestie! πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from