Logoj0ke.net Open Build Service > Projects > server:monitoring > nagios-plugins-nwc-health > Binaries > nagios-plugins-nwc-health-8... > Dependencies
Sign Up | Log In

Dependency of nagios-plugins-nwc-health-8.0-1.1.src.rpm

Name: perl-Try-Tiny

Project: openSUSE_13.2

Repository: oss

Title: Minimal try/catch with proper preservation of $@

Description:
This module provides bare bones 'try'/'catch'/'finally' statements that are
designed to minimize common mistakes with eval blocks, and NOTHING else.

This is unlike the TryCatch manpage which provides a nice syntax and avoids
adding another call stack layer, and supports calling 'return' from the
'try' block to return from the parent subroutine. These extra features come
at a cost of a few dependencies, namely the Devel::Declare manpage and the
Scope::Upper manpage which are occasionally problematic, and the additional
catch filtering uses the Moose manpage type constraints which may not be
desirable either.

The main focus of this module is to provide simple and reliable error
handling for those having a hard time installing the TryCatch manpage, but
who still want to write correct 'eval' blocks without 5 lines of
boilerplate each time.

It's designed to work as correctly as possible in light of the various
pathological edge cases (see the /BACKGROUND manpage) and to be compatible
with any style of error values (simple strings, references, objects,
overloaded objects, etc).

If the 'try' block dies, it returns the value of the last statement
executed in the 'catch' block, if there is one. Otherwise, it returns
'undef' in scalar context or the empty list in list context. The following
examples all assign '"bar"' to '$x':

my $x = try { die "foo" } catch { "bar" };
my $x = try { die "foo" } || { "bar" };
my $x = (try { die "foo" }) // { "bar" };

my $x = eval { die "foo" } || "bar";

You can add 'finally' blocks, yielding the following:

my $x;
try { die 'foo' } finally { $x = 'bar' };
try { die 'foo' } catch { warn "Got a die: $_" } finally { $x = 'bar' };

'finally' blocks are always executed making them suitable for cleanup code
which cannot be handled using local. You can add as many 'finally' blocks
to a given 'try' block as you like.

Version: 0.22

Release: 2.1.3

Architecture: noarch

Size: 24.3 KB

Build Time: 2014-10-06 16:43:01 +0200 (over 9 years ago)

Requires

Symbol Provided by
perl(:MODULE_COMPAT_5.20.1) perl