Venus::Role::Tryable

Tryable Role

Tryable Role for Perl 5

method: try

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.

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.

try(Str | CodeRef $method, Any @args) (Try)

{ since => '0.01', }

=example-1 try

package main;

my $example = Example->new;

my $try = $example->try('test');

# my $value = $try->result;

t/Venus.t: pdml: authors t/Venus.t: pdml: license

10 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 45:

Unknown directive: =synopsis

Around line 75:

Unknown directive: =description

Around line 84:

Unknown directive: =method

Around line 90:

Unknown directive: =signature

Around line 94:

Unknown directive: =metadata

Around line 124:

Unknown directive: =partials