---
name: "Web::MREST::CLI::Parser"
section: "3pm"
platform: "linux"
package: "libweb-mrest-cli-perl"
version: "0.284-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Web::MREST::CLI::Parser"
---

# Web::MREST::CLI::Parser(3pm)

Parser for demo MREST command line client

## NAME

Web::MREST::CLI::Parser - Parser for demo MREST command line client

## SYNOPSIS

```
    use Try::Tiny;

    my $status;
    my @tokens = split /\s+/, 'MY SAMPLE COMMAND';
    try {
        Web::MREST::CLI::Parse::parse_tokens( [], \@tokens );
    } catch {
        $status = $_;
    };
```

## CLI COMMANDS

The parsing of CLI commands takes place in the `"parse_tokens"` function, which calls itself recursively until it gets to a rather macabre-sounding

```
    die send_req . . .
```

This causes control to return to the while loop in `"bin/mrest-cli"` with the return value of the `"send_req"`, which is a status object.

All tokens should be chosen to be distinguishable by their first three characters.
