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

Class::Struct::FIELDS 1.1

  Date Added: March 07, 2010  |  Visits: 944

Class::Struct::FIELDS

Report Broken Link
Printer Friendly Version


Product Homepage
Download (92 downloads)



Class::Struct::FIELDS module combine Class::Struct, base and fields. SYNOPSIS (This page documents Class::Struct::FIELDS v.1.1.) use Class::Struct::FIELDS; # declare struct, based on fields, explicit class name: struct (CLASS_NAME => { ELEMENT_NAME => ELEMENT_TYPE, ... }); use Class::Struct::FIELDS; # declare struct, based on fields, explicit class name # with inheritance: struct (CLASS_NAME => [qw(BASE_CLASSES ...)], { ELEMENT_NAME => ELEMENT_TYPE, ... }); package CLASS_NAME; use Class::Struct::FIELDS; # declare struct, based on fields, implicit class name: struct (ELEMENT_NAME => ELEMENT_TYPE, ...); package CLASS_NAME; use Class::Struct::FIELDS; # declare struct, based on fields, implicit class name # with inheritance: struct ([qw(BASE_CLASSES ...)], ELEMENT_NAME => ELEMENT_TYPE, ...); package MyObj; use Class::Struct::FIELDS; # declare struct with four types of elements: struct (s => $, a => @, h => %, x => &, c => My_Other_Class); $obj = new MyObj; # constructor # scalar type accessor: $element_value = $obj->s; # element value $obj->s (new value); # assign to element # array type accessor: $ary_ref = $obj->a; # reference to whole array $ary_element_value = $obj->a->[2]; # array element value $ary_element_value = $obj->a (2); # same thing $obj->a->[2] = new value; # assign to array element $obj->a (2, newer value); # same thing # hash type accessor: $hash_ref = $obj->h; # reference to whole hash $hash_element_value = $obj->h->{x}; # hash element value $hash_element_value = $obj->h (x); # same thing $obj->h->{x} = new value; # assign to hash element $obj->h (x, newer value); # same thing # code type accessor: $code_ref = $obj->x; # reference to code $obj->x->(...); # call code $obj->x (sub {...}); # assign to element # regexp type accessor: $regexp = $obj->r; # reference to code $string =~ m/$obj->r/; # match regexp $obj->r (qr/ ... /); # assign to element # class type accessor: $element_value = $obj->c; # object reference $obj->c->method (...); # call method of object $obj->c (My_Other_Class::->new); # assign a new object Class::Struct::FIELDS exports a single function, struct. Given a list of element names and types, and optionally a class name and/or an array reference of base classes, struct creates a Perl 5 class that implements a "struct-like" data structure with inheritance. The new class is given a constructor method, new, for creating struct objects. Each element in the struct data has an accessor method, which is used to assign to the element and to fetch its value. The default accessor can be overridden by declaring a sub of the same name in the package. (See Example 2.) Each elements type can be scalar, array, hash, code or class..

Requirements: No special requirements
Platforms: Linux
Keyword: Assign Based On Classstructfields Element Fields Hash Libraries Name New Programming Reference To Struct Type Value
Users rating: 0/10

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


CLASS::STRUCT::FIELDS RELATED
Modules  -  Sessions based on files instead of mysql 1.0
Sessions based on files system instead of mysql database.If you want to save the maximum of mysql ressource and gain time loading your pages, try this hack.It is simple to install and works fine.Just follow install.txt
 
Utilities  -  ALT Linux 4.0.1(Server)
ALT Linux project is a set of Linux distributions that are based on Sisyphus, an APT-enabled RPM package repository that aims to achieve feature completeness, usability, and security in a sensible and manageable mixture. Whats New in This...
605.3 MB  
Multimedia & Graphics  -  Relative-Scoring 1.0.1
Relative-Scoring is a scoring script which sets the score for tracks based on the number of times a song has been listened to compared to the most played song. Increase the score by listening to a track more! It was modified from the default...
7.17 KB  
Utilities  -  Grig for Linux 0.8.0
Grig is a simple Ham Radio control (CAT) program based on the Ham Radio Control Libraries (Hamlib). It is intended to be highly generic presenting the user to the same graphical user interface regardless of which radio is being controlled.
501.76 KB  
Development Tools  -  Launch a program based on file extension 1.0
This script associates or launches an action to be performed by the os based on filename extension. For example, assoc.py -e test.c will launch emacs. The optional extra_args allows you to add additional settings to the command associated with the...
 
Modules  -  Multiple flat shipping rates based on Order Total 1.0
This small contribution is based on the "Percent Rate x total sale price" shipping contribution originally posted by WebyMaster and modified by many. All credit to all who came before!Basically it works like this:> The shipping cost will vary...
 
Modules  -  Shipping Method Based On Order Total 1.0
This contribution will allow you to choose the shipping method based on the total order, i.e. for orders under $200, ship with USPS, while for orders over $200, ship with UPS. It will also allow you to enable/disable shipping, depending on whether...
 
Development Tools  -  Hamilton-Jacobi solver on unstructured triangular grids 1.0
Implementation based on:"Finite-Element Discretization Of Static Hamilton-Jacobi Equations Based On A Local Variational Principle"by F. Bornemann and C. RaschComments:1. There is no restriction on the type of triangulation, i.e. it does not need...
307.2 KB  
Modules  -  Table Quote - Shipping cost based on total ranges 6.x-2.0
This module is a 3rd party module for doDUbercart allowing to calculate shipping cost based on total order weight or total order price, and managing ranges.You can define weight ranges: a lower weight, an upper weight and a cost.An order which...
10 KB  
Audio Tools  -  audioBox 0.2.0
audioBox is a Linux mp3/ogg player front-end based on LCDproc, mpg123 (or mpg321) and ogg123. It is intended to run on a standalone headless Linux machine as an "audio appliance", playing music files from the local hard disk or CD-ROM. You dont...
245.76 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