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 29.544.688 Times

Perl6::Parameters 0.03

  Date Added: November 24, 2010  |  Visits: 627

Perl6::Parameters

Report Broken Link
Printer Friendly Version


Product Homepage
Download (73 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  
Libraries  -  OSSP js 1.6.20070208
OSSP js is a stand-alone distribution of the JavaScript (JS) programming language reference implementation from Mozilla -- aka "JSRef" or "SpiderMonkey". OSSP js provides a smart, stand-alone and portable distribution of Mozilla JavaScript...
1024 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  -  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  -  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  -  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  -  CIPP 3.0.8
CIPP Perl module contains a Reference Manual to CIPP, the powerful preprocessor language for embedding Perl and SQL in HTML. SYNOPSIS perldoc CIPP::Manual This documentation module is part of the CIPP distribution which is available on CPAN....
143.36 KB  
Libraries  -  vars::global 0.0.1
vars::global is a Perl module that tries to make global variables a little safer. SYNOPSIS # In the place/package where we want to create globals use vars::global create => qw( $foo @bar %baz ); # Add some more global symbols...
7.17 KB  
Libraries  -  Mail::Addressbook::Convert::Pine 1.1
Mail::Addressbook::Convert::Pine is a Perl module that convert to and from Pine formatted addressbooks. SYNOPSIS use strict; use Mail::Addressbook::Convert::Pine; my $pine = new Mail::Addressbook::Convert::Pine(); my $PineInFile...
30.72 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB