Class::Usul::TraitFor::RunningMethods - Try and run a method catch and handle any exceptions
use Moo; extends 'Class::Usul'; with 'Class::Usul::TraitFor::RunningMethods';
Implements the "run" method which calls the target method in a try / catch block. Handles any resulting exceptions
Defines the following command line options;
c method
The method in the subclass to dispatch to
o options key=value
The method that is dispatched to can access the key/value pairs from the $self->options hash ref
$self->options
umask
An octal number which is used to set the umask by the "run" method
v verbose
Repeatable boolean that increases the verbosity of the output
Defines the following attributes;
params
A hash reference keyed by method name. The values are array references which are flattened and passed to the method call by "run"
$exit_code = $self->run;
Call the method specified by the -c option on the command line. Returns the exit code
-c
$exit_code = $self->run_chain( $method );
Called by "run" when "select_method" cannot determine which method to call. Outputs usage if method is undefined. Logs an error if method is defined but not (by definition a callable method). Returns exit code FAILED
method
FAILED
$method = $self->select_method;
Called by "run" it examines the "method" attribute and if necessary the extra command line arguments to determine the method to call
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Usul. Patches are welcome
Larry Wall - For the Perl programming language
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2018 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install Class::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Usul
CPAN shell
perl -MCPAN -e shell install Class::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.