Getopt::Long::Descriptive::Usage(3) User Contributed Perl Documentation Getopt::Long::Descriptive::Usage(3)

# [SYNOPSIS](#SYNOPSIS)

```
  use Getopt::Long::Descriptive;
  my ($opt, $usage) = describe_options( ... );
  $usage->text; # complete usage message
  $usage->die;  # die with usage message
```

# [DESCRIPTION](#DESCRIPTION)

This document only describes the methods of the Usage object. For information on how to use Getopt::Long::Descriptive, consult its documentation.

# [METHODS](#METHODS)

## [new](#new)

```
  my $usage = Getopt::Long::Descriptive::Usage->new(\%arg);
```

You **really** don't need to call this. GLD will do it for you.

Valid arguments are:

```
  options     - an arrayref of options
  leader_text - the text that leads the usage; this may go away!
```

## [text](#text)

This returns the full text of the usage message.

## [leader\_text](#leader_text)

This returns the text that comes at the beginning of the usage message.

## [option\_text](#option_text)

This returns the text describing the available options.

## [warn](#warn)

This warns with the usage message.

## [die](#die)

This throws the usage message as an exception.

```
  $usage_obj->die(\%arg);
```

Some arguments can be provided

```
  pre_text  - text to be prepended to the usage message
  post_text - text to be appended to the usage message
```

The "pre\_text" and "post\_text" arguments are concatenated with the usage message with no line breaks, so supply this if you need them.

2026-10-25 perl v5.44.0

---

Document: Getopt::Long::Descriptive::Usage(3pm) from perl-getopt-long-descriptive 0.117-r4 (Chainguard OS)
Source: https://github.com/rjbs/Getopt-Long-Descriptive
