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

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

Serving Software Downloads in 956 Categories, Downloaded 50.320.195 Times

Perl6::Parameters 0.03

  Date Added: November 24, 2010  |  Visits: 902

Perl6::Parameters

Report Broken Link
Printer Friendly Version


Product Homepage
Download (91 downloads)



Perl6::Parameters is a module with Perl 6-style prototypes with named parameters. SYNOPSIS use Perl6::Parameters; sub mysub($foo, ARRAY $bar, *%rest) { ... } DETAILS Perl6::Parameters is a Perl module which simulates Perl 6s named parameters. (When I talk about "named parameters" I mean something like the parameters youre used to from C, Java and many other languages--not pass-a-hash-with-the-parameters-in-it things.) Like most other programming languages, Perl 6 will support subroutines with pre-declared variables the parameters are put into. (Using this will be optional, however.) This goes far beyond the "line-noise prototypes" available in Perl 5, which only allow you to control context and automatically take references to some parameters--lines like my($first, $second)=(@_) will no longer be necessary. Although Perl 6 will have this, Perl 5 doesnt; this module makes it so that Perl 5 does. It uses some other Perl 6-isms too, notably the names for builtin types and the unary-asterisk notation for flattening a list. Crafting Parameter Lists Crafting parameter lists is simple; just declare your subroutine and put the parameters separated by commas or semicolons, in parenthesis. (Using a semicolon signifies that all remaining parameters are optional; this may not be available this way in Perl 6, but Im assuming it is until I hear otherwise.) Most parameters are just variable names like $foo; however, more sophisticated behavior is possible. There are three ways to achieve this. The first way is by specifying a type for the variable. Certain types make the actual parameters turn into references to themselves: ARRAY $foo This turns an array into a reference to itself and stores the reference into $foo. HASH $foo This turns a hash into a reference to itself and stores the reference into $foo. CODE $foo This turns a subroutine into a reference to itself and stores the reference into $foo. SCALAR $foo This turns a scalar into a reference to itself and stores the reference into $foo. GLOB $foo This turns a typeglob into a reference to itself and stores the reference into $foo. Typeglobs will be going away in Perl 6; this type exists in this module so that its useful for general use in Perl 5. REF $foo This turns any parameter into a reference to itself and stores it into $foo. This only works in Perl 5.8. Otherwise, its treated the same as any other unrecognized type name. AnythingElse $foo This has no effect in this module; its treated as though youd typed $foo without the AnythingElse. For example, if a subroutine had the parameters ($foo, HASH $bar, CODE $baz) and was called with ($scalar, %hash, &mysub) the subroutine would get the contents of $scalar, a reference to %hash and a reference to &mysub. The second way is by supplying an actual array or hash as a parameter name. This requires an array or hash to be passed in for that parameter; it preserves the length of the array or hash. The final way is only available for the last parameter: if an array or hash is prefixed with an asterisk, that array or hash will be filled with any additional parameters..

Requirements: No special requirements
Platforms: Linux
Keyword: Array Foo Hash Libraries Parameters Perl Programming Reference Reference To
Users rating: 0/10

License: Freeware Size: 4.1 KB
USER REVIEWS
More Reviews or Write Review


PERL6::PARAMETERS RELATED
Libraries  -  Class::Method::hash 2.08
Class::Method::hash is a Perl module that helps you create methods for handling a hash value. SYNOPSIS use Class::MethodMaker [ hash => [qw/ x /] ]; $instance->x; # empty $instance->x(a => 1, b => 2, c => 3); $instance->x_count == 3; #...
89.09 KB  
Network & Internet  -  mod_perl 2.0.3
mod_perl project brings together the full power of the Perl programming language and the Apache HTTP server. You can use Perl to manage Apache, respond to requests for web pages and much more. mod_perl gives you a persistent Perl interpreter...
3.5 MB  
Libraries  -  Perl6::Contexts 0.4
Perl6::Contexts - array and hash variables turn into references to themselves when used in non-numeric scalar context or as function arguments. SYNOPSIS my @foo = ( 1 .. 20 ); my $foo = @foo; # same as: my $foo = @foo; my $foo = 0 + @foo; #...
17.41 KB  
Libraries  -  Taint 0.07
Taint is a Perl extension to taint variables. SYNOPSIS use Taint; taint($taintvar[, $anothervar[, $yetmorevars]]); $bool = tainted($vartocheck); taint() marks its arguments as tainted. tainted() returns true if its argument is tainted,...
4.1 KB  
Libraries  -  Set::Hash 0.01
Set::Hash is a Perl module with hashes as objects with lots of handy methods (including set comparisons) and support for method chaining. SYNOPSIS use Set::Hash; my $sh1 = Set::Hash->new(name=>"dan",age=>33); my $sh2 =...
7.17 KB  
Libraries  -  Tie::FlatFile::Array 0.03
Tie::FlatFile::Array is a Perl extension which treats a flatfile database as an array of arrays. This module allows the programmer to treat a flatfile database as as array of arrays. For example, lets say you have a datafile that has...
5.12 KB  
Libraries  -  Tie::Proxy::Hash 1.01
Tie::Proxy::Hash is a Perl module created to efficiently merge & translate hashes. SYNOPSIS my (%hash, $ref); $ref = tie %hash, Tie::Proxy::Hash, (bart => +{a => 1, b => 2}, maggie => +{a => 5, c => 6, e => 10}, ); $hash{a} == 1; # true...
19.46 KB  
Libraries  -  Pogo 0.10
Pogo is a Perl interface for GOODS. SYNOPSIS use Pogo; $pogo = new Pogo sample.cfg; # connect to a database $root = $pogo->root_tie; # get a reference to root hash in the database $root->{key1} = "string"; # store a string into the...
12.29 KB  
Libraries  -  Wais 2.311
Wais is a Perl module with access to freeWAIS-sf libraries. USAGE The main high-level interface are the functions Wais::Search and Wais::Retrieve. Both return a reference to an object of the class Wais::Result. Wais::Search Arguments of...
54.27 KB  
Libraries  -  Geo::Lookup::ByTime 0.0.2
Geo::Lookup::ByTime is a Perl module to lookup location by time. SYNOPSIS use Geo::Lookup::ByTime; $lookup = Geo::Lookup::ByTime->new( @points ); my $pt = $lookup->nearest( $tm ); Given a set of timestamped locations guess the location at...
15.36 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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 4.0.0
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