Main > Programming > Libraries >

Commands::Guarded 0.01

Commands::Guarded 0.01

Sponsored Links

Commands::Guarded 0.01 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.012 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 886
Date added: 2007-05-23
Publisher: Trey Harris

Commands::Guarded 0.01 description

Commands::Guarded Perl package provides better scripts through guarded commands.

SYNOPSIS

use Commands::Guarded;

my $var = 0;

step something =>
ensure { $var == 1 }
using { $var = 1 }
; # $var is now 1

step nothing =>
ensure { $var == 1 }
using { $var = 2 } # bug!
; # $var is still 1 (good thing too)

my $brokeUnless5 =
step brokenUnless5 =>
ensure { $var == 5 }
using { $var = shift }
; # nothing happens yet

print "var: $varn"; # prints 1

$brokeUnless5->do(5);

print "now var: $varn"; # prints 5

step fail =>
ensure { $var == 3 }
using { $var = 2 }
; # Exception thrown here

This module implements a deterministic, rectifying variant on Dijkstras guarded commands. Each named step is passed two blocks: an ensure block that defines a test for a necessary and sufficient condition of the step, and a using block that will cause that condition to obtain.

If step is called in void context (i.e., is not assigned to anything or used as a value), the step is run immediately, as in this pseudocode:

unless (ENSURE) {
USING;
die unless ENSURE;
}

If step is called in scalar or array context, execution is deferred and instead a Commands::Guarded object is returned, which can be executed as above using the do method. If do is given arguments, they will be passed to the ensure block and (if necessary) the using block.

The interface to Commands::Guarded is thus a hybrid of exported subroutines (see SUBROUTINES below) and non-exported methods (see METHODS).
For a detailed discussion of the reason for this modules existence, see RATIONALE below.

Commands::Guarded 0.01 Screenshot

Advertisements

Commands::Guarded 0.01 Keywords

Bookmark Commands::Guarded 0.01

Hyperlink code:
Link for forum:

Commands::Guarded 0.01 Copyright

WareSeeker periodically updates pricing and software information of Commands::Guarded 0.01 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Commands::Guarded 0.01 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
mod_include is a post processing of SSI variables, Apache module. Free Download
SIAR (Simple IP Account Reporter) is a plug-in for pmacct (Promiscuous Mode IP Accounting Package). Free Download
mount_and open is a service menu is a port of media_realfolder and the perlscript kio_media_realfolder. Free Download
Email::Handle is a Objective Email Handler. Free Download
ex::constant::vars is a Perl pragma to create readonly variables. Free Download
Lingua::ZH::DateTime is a Perl module to convert time to chinese format. Free Download
Convert::CharMap is a Perl module that can conversion between Unicode Character Maps. Free Download
WWW::NanoRef is a Perl module that uses the API published by nanoref.com to produce shortened URLs. Free Download