Web::MREST::CLI::Parser - Parser for demo MREST command line client
use Try::Tiny; my $status; my @tokens = split /\s+/, 'MY SAMPLE COMMAND'; try { Web::MREST::CLI::Parse::parse_tokens( [], \@tokens ); } catch { $status = $_; };
The parsing of CLI commands takes place in the parse_tokens function, which calls itself recursively until it gets to a rather macabre-sounding
parse_tokens
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.
bin/mrest-cli
send_req
All tokens should be chosen to be distinguishable by their first three characters.
To install Web::MREST::CLI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::MREST::CLI
CPAN shell
perl -MCPAN -e shell install Web::MREST::CLI
For more information on module installation, please visit the detailed CPAN module installation guide.