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

Class::Struct::FIELDS 1.1

  Date Added: March 07, 2010  |  Visits: 523

Class::Struct::FIELDS

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
USER REVIEWS
More Reviews or Write Review


CLASS::STRUCT::FIELDS RELATED
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  -  levy 1.22
levy is a perl script which generates a basic iptables rulesets based on a given external interface and a set of ports to open. Its design is to save folks some time in creating a skeleton ruleset to work from, though it can construct a fully...
9.22 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  
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  -  wolfSSL 3.11.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...
2.73 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