Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 32.402.378 Times

Method::Declarative 0.03

  Date Added: July 24, 2010  |  Visits: 542


Report Broken Link
Printer Friendly Version

Product Homepage
Download (70 downloads)

Method::Declarative is a Perl module to create methods with declarative syntax. SYNOPSIS use Method::Declarative ( --defaults => { precheck => [ [ qw(precheck1 arg1 arg2) ], # ... ], postcheck => [ [ qw(postcheck1 arg3 arg4) ], # ... ], init => [ [ initcheck1 ], # ... ], end => [ [ endcheck1 ], # ... ], once => [ [ oncecheck1 ], ] , package => __CALLER__::internal, }, method1 => { ignoredefaults => [ qw(precheck end once) ], code => __method1, }, ) ; The Method::Declarative module creates methods in a using class namespace. The methods are created using a declarative syntax and building blocks provided by the using class. This class does not create the objects themselves. The using class invokes Method::Declarative, passing it list of key-value pairs, where each key is the name of a method to declare (or the special key --default) and a hash reference of construction directives. The valid keys in the construction hash refs are: code The value corresponding to code key is a method name or code reference to be executed as the method. It is called like this: $obj->$codeval(@args) where $obj is the object or class name being used, $codeval is the coresponding reference or method name, and @args are the current arguments for the invocation. If $codeval is a method name, it needs to be reachable from $obj. A code key in a method declaration will override any code key set in the --defaults section. end The value corresponding to the end key is an array reference, where each entry of the referenced array is another array ref. Each of the internally referenced arrays starts with a code reference or method name. The remaining elements of the array are used as arguments. Each method declared by the arrays referenced from end are called on the class where the declared method resides in an END block when Method::Declarative unloads. Each method is called like this: $pkg->$codeval($name[, @args]); where $pkg is the package or class name for the method, $name is the method name, and @args is the optional arguments that can be listed in each referenced list. end blocks are run in the reverse order of method declaration (for example, if method1 is declared before method2, method2s end declaration will be run before method1s), and for each method they are run in the order in which they are declared. Note that this is not an object destructor, and no objects of a particular class may still exist when these methods are run. ignoredefaults The value corresponding to the ignoredefaults key is an array reference pointing to a list of strings. Each string must corespond to a valid key, and indicates that any in-force defaults for that key are to be ignored. See the section on the special --defaults method for details. init The value corresponding to the init key is identical in structure to that corresponding to the end key. The only difference is that the declared methods/code refs are executed as soon as the method is available, rather than during an END block. once The value corresponding to the once key is identical in structure to that corresponding to the end key. The values are used when the method is invoked, however. If the method is invoked on an object based on a hash ref, or on the class itself, and it has not been invoked before on that object or hash ref, the methods and code refs declared by this key are executed one at a time, like this: $obj->$codeval($name, $isscalar, $argsref[, @args ]); where $obj is the object or class on which the method is being invoked, $codeval is the method name or code reference supplied, $name is the name of the method, $isscalar is a flag to specify if the declared method itself is being executed in a scalar context, $argsref is a reference to the method arguments (@_, in other words), and @args are any optional arguments in the declaration. The return value of each method or code reference call is used as the new arguments array for successive iterations or the declared method itself (including the object or class name). Yes, that means that these functions can change the the object or class out from under successive operations. Any method or code ref returning an empty list will cause further processing for the method to abort, and an empty list or undefined value (as appropriate for the context) will be returned as the declared methods return value. package The value coresponding to the package key is a string that determines where the declared method is created (which is the callers package by default, unless modified with a --defaults section). The string __CALLER__ can be used to specify the callers namespace, so constructions like the one in the synopsis can be used to create methods in a namespace based on the calling package namespace. postcheck The value coresponding to the postcheck key is identical in structure to that coresponding to the end key. The postcheck operations are run like this: $obj->$codeval($name, $isscalar, $vref[, @args ]); where $obj is the underlying object or class, $codeval is the method or code ref from the list, $name is the name of the declared method, $isscalar is the flag specifying if the declared method was called in a scalar context, $vref is an array reference of the currently to-be-returned values, and @args is the optional arguments from the list. Each method or code reference is expected to return the value(s) it wishes to have returned from the method. Returning a null list does NOT stop processing of later postcheck declarations. precheck The precheck phase operates similarly to the once phase, except that its triggered on all method calls (even if the underlying object is not a hash reference or a class name). Any illegal or unrecognized key will cause a warning, and processing of the affected hashref will stop. This means a --defaults section will be ineffective, or a declared method wont be created..

Requirements: No special requirements
Platforms: Linux
Keyword: Class Class Name Code Create Methods Declared End Key Key Method Method Name Methoddeclarative Name Perl Module To Create To The End
Users rating: 0/10

License: Freeware Size: 8.19 KB
More Reviews or Write Review

Libraries  -  Java::JCR::Nodetype 0.08
Java::JCR::Nodetype is a Perl module that can load the JCR node type class wrappers. SYNOPSIS use Java::JCR::Nodetype; This loads the Perl classes mapped to the javax.jcr.nodetype package. You might notice the odd letter case of this...
48.13 KB  
Libraries  -  Gtk2::GladeXML 1.005
Gtk2::GladeXML is a Perl module that create user interfaces directly from Glade XML files. SYNOPSIS # for a pure gtk+ glade project use Gtk2 -init; use Gtk2::GladeXML; $gladexml = Gtk2::GladeXML->new(;...
34.82 KB  
Libraries  -  HTML::Adsense 0.1
HTML::Adsense is a Perl module that can create adsense widgets easily. SYNOPSIS This module wraps Google Adsense ad creation in OO perl code. use HTML::Adsense; my $myad = HTML::Adsense->new( client => pub-4763368282156432, ); # OR...
4.1 KB  
Libraries  -  OpenInteract2::Manual::Tutorial 1.99_06
OpenInteract2::Manual::Tutorial is a Perl module that will teach learn you how to create and modify a package. SYNOPSIS This tutorial will show you the different methods for creating a package and how to maintain them. CREATING THE PACKAGE...
931.84 KB  
Libraries  -  B::Generate 1.06
B::Generate is a Perl module which you can create your own op trees. SYNOPSIS use B::Generate; # Do nothing, slowly. CHECK { my $null = new B::OP("null",0); my $enter = new B::OP("enter",0); my $cop = new B::COP(0, "hiya", 0); my $leave...
12.29 KB  
Libraries  -  ExtUtils::SVDmaker 0.10
ExtUtils::SVDmaker is a Perl module to create CPAN distributions. SYNOPSIS use ExtUtils::SVDmaker; $svd = new ExtUtils::SVDmaker( @options ); $svd = new ExtUtils::SVDmaker( %options ); $svd->vmake( @targets, %options ); $svd->vmake(...
276.48 KB  
Libraries  -  Tk::Canvas 804.027
Tk::Canvas Perl module can create and manipulate Canvas widgets. SYNOPSIS $canvas = $parent->Canvas(?options?); STANDARD OPTIONS -background -highlightthickness -insertwidth -state -borderwidth -insertbackground -relief -tile -cursor...
5.7 MB  
Libraries  -  Template::TT2Site 0.95
Template::TT2Site is a Perl module to create standard web sites with the Template Toolkit. SYNOPSIS $ mkdir NewSite $ cd NewSite $ tt2site setup ... make your pages ... $ tt2site build ... point your browser at html/index.html ......
35.84 KB  
Medical  -  Hospice El Paso 2.3.11
HOSPICE EL PASO-YOUR COMMUNITY HOSPICE Hospice El Paso, a not-for-profit organization, is the oldest Hospice in our community. The mission of Hospice El Paso is simple: to provide comfort, care, hope, and choice to patients at the end of...
9.7 MB  
Libraries  -  CPAN::Mini::Extract 1.16
CPAN::Mini::Extract is a Perl module that can create CPAN::Mini mirrors with the archives extracted. SYNOPSIS # Create a CPAN extractor my $cpan = CPAN::Mini::Extract->new( remote =>, local =>...
26.62 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB