Venus::Role::Tryable - Tryable Role
Tryable Role for Perl 5
package Example; use Venus::Class 'with'; use Venus 'raise'; with 'Venus::Role::Tryable'; sub test { raise 'Example::Error'; } package main; my $example = Example->new; # $example->try('test');
This package modifies the consuming package and provides a mechanism for handling potentially volatile routines.
This package provides the following methods:
try(Str | CodeRef $method, Any @args) (Try)
The try method returns a Venus::Try object having the invocant, callback, arguments pre-configured. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.
Since 0.01
0.01
package main; my $example = Example->new; my $try = $example->try('test'); # my $value = $try->result;
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.