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.079.296 Times

Variable::Strongly::Typed 1.1.0

  Date Added: September 23, 2010  |  Visits: 780

Variable::Strongly::Typed

Report Broken Link
Printer Friendly Version


Product Homepage
Download (94 downloads)



Variable::Strongly::Typed is a Perl module to let some variables be strongly typed. SYNOPSIS use Variable::Strongly::Typed; my $int :TYPE(int); # must have an int value my $float :TYPE(float); # must have a float value my $string :TYPE(string); # must not be a reference my $file :TYPE(IO::File); # must be an IO::File my @array_of_ints :TYPE(int); # Each slot must contain # an int my %hash_of_floats :TYPE(float); # Each value must be a float my $int_own_error :TYPE(int, &my_own_error_handler); # Roll my own error handler my @array_of_rgb :TYPE(&red_green_blue); # my enumerated type # For subs!! sub return_an_int :TYPE(int) { # .. do some stuff .. return $something; } # ... and later ... $int = 23; # All is well $int = howdy!; # This line will croak with a good error message $float = 3.23; # All is well, nothing to see here $float = new XML::Parser; # croak! $array_of_ints[23] = 44; # Groovy $array_of_ints[12] = yah; # croak! $hash_of_floats{pi} = 3.14159; # no problem $hash_of_floats{e} = new IO::File; # croak! # Return 1 if this val is RED, BLUE, or GREEN # 0 otherwise sub red_green_blue { local $_ = shift; /A RED z/xms || /A BLUE z/xms || /A GREEN z/xms; } $array_of_my_very_own_types[23] = 99; # croak! $array_of_my_very_own_types[2] = BLUE; # OK! $int_own_error = lksdklwe; # The sub my_own_error_hanlder # will be # called with the # offending value my $got_it = return_an_int(); # Will croak (or call your error # function) # if this sub doesnt # return an int This modules allow you to strongly type your variables. Also known as the no fun module - it can greatly enhance you codes quality and robustness. By enforcing types on some (or all) of your variables you will eliminate a large class of careless (& not so careless) errors. This could also aid an editor or code-browsing tools to verify code correctness without having to execute the script..

Requirements: No special requirements
Platforms: Linux
Keyword: Array Blue Error Float Int Io Libraries Own Perl Module Programming To Let Variables Variablestronglytyped
Users rating: 0/10

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


VARIABLE::STRONGLY::TYPED RELATED
Libraries  -  Iterator::IO 0.02
Iterator::IO is a Perl module with filesystem and stream iterators. SYNOPSIS use Iterator::IO; # Return the names of files in a directory (except . and ..) $iter = idir_listing ($path); # Return all the files in a directory tree, one at a...
14.34 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  -  PDL::IO::Misc 2.4.3
PDL::IO::Misc is a Perl module with misc IO routines for PDL. rcols() Read ASCII whitespaced cols from a file into piddles and perl arrays (also see "rgrep()"). There are two calling conventions - the old version, where a pattern can be...
2.1 MB  
Libraries  -  Variable::Strongly::Typed::Array 1.1.0
Variable::Strongly::Typed::Array is a Perl module for strongly typed array. SYNOPSIS This class is utilized by Variable::Strongly::Typed - you dont access this directly my @array_of_ints :TYPE(int); # Each slot must contain an int my...
10.24 KB  
Libraries  -  CAD::Drawing::IO::Tk 0.04
CAD::Drawing::IO::Tk is a Perl module with GUI I/O methods for CAD::Drawing. This module is considered extremely pre-ALPHA and its use is probably deprecated by the time you read this. Methods There is no constructor for this class, its...
8.19 KB  
Libraries  -  CAD::Drawing::IO::PgDB 0.03
CAD::Drawing::IO::PgDB is a Perl module with PostgreSQL save / load methods. This module is considered pre-ALPHA and under-documented. Its use is strongly discouraged except under experimental conditions. Particularly susceptible to change will...
8.19 KB  
Libraries  -  IO::Pipe::Producer 1.5
IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. SYNOPSIS # Module which provides 2 methods: getSubroutineProducer # and getSystemProducer. They take a subroutine reference # (with...
6.14 KB  
Libraries  -  IO::Interactive 0.0.3
IO::Interactive is a Perl module with utilities for interactive I/O. SYNOPSIS use IO::Interactive qw(is_interactive interactive busy); if ( is_interactive() ) { print "Running interactivelyn"; } # or... print {interactive} "Running...
5.12 KB  
Libraries  -  IO::Prompt 0.99.4
IO::Prompt is a Perl module to interactively prompt for user input. SYNOPSIS use IO::Prompt; while( prompt "next: " ) { print "You said $_n"; } By default, this module exports a single function prompt. It prompts the user to enter some...
14.34 KB  
Libraries  -  IO::Busy 0.0.3
IO::Busy is a Perl module to intercept terminal input while something else is happening. SYNOPSIS use IO::Busy; my $fh = busy { non_interactive_stuff(); }; This module exports a single subroutine, named busy. That subroutine takes a...
4.1 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