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

Class::Struct::FIELDS 1.1

  Date Added: March 07, 2010  |  Visits: 586


Report Broken Link
Printer Friendly Version

Product Homepage
Download (72 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
More Reviews or Write Review

Games  -  CAZ Fusion 1.1
Did you know? You have 100 billion neurons inside your brain. And now with CAZ Fusion, you can use every single one of them. CAZ Fusion is a new kind of Puzzle-Game based on the worldwide success "CAZ". Help the new hero Zac to find...
8.5 MB  
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  -  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  
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  
Utilities  -  AlienDrive Live CD 1.0
AlienDrive Live CD is a linux distribution based on the SLAX Operating System. It is sometimes affectionately referred to by the people who love it as "The Alien". It was designed specifically to function as a Digital Audio Workstation and...
211 MB  
Education  -  FlashBack 0.4 pre6
FlashBack is a flashcard scheduler based on a variant of Sebastian Leitners method. It allows one to create and review simple (text only) flash cards. It supports Unicode and complex scripts (via Pango). A simple, tab-separated cardfile format...
49.15 KB  
Network & Internet  -  cdServer 0.8
cdServer is a simple HTTP server based on the standard Python library module SimpleHTTPServer. cdServer is designed to serve (static) contents off a CD-ROM. cdServer provides a simple interface for special (interactive) functions implemented in an...
84.99 KB  
Arcade Style Games  -  StarWar 0.0.1d
StarWar project is a space-shooting game based on ClanLib. It is a 2D space shooting game similar to xsoldier. It is multiplataform and suports sprite trasparencies, full screen, or windowed mode.. Star War is a 2D space shooter game based on...
747.52 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