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

MMDS::Properties 1.902

  Date Added: September 25, 2010  |  Visits: 829

MMDS::Properties

Report Broken Link
Printer Friendly Version


Product Homepage
Download (99 downloads)



MMDS::Properties Perl module contains flexible properties handling for MMDS. use MMDS::Properties; my $cfg = new MMDS::Properties; # Preset a property. $cfg->set_property("config.version", "1.23"); # Parse a properties file. $cfg->parsefile("config.prp"); # Get a property value $version = $cfg->get_property("config.version"); # Same, but with a default value. $version = $cfg->get_property("config.version", "1.23"); # Get the list of subkeys for a property, and process them. my $aref = $cfg->get_property_keys("item.list"); foreach my $item ( @$aref ) { if ( $cfg->get_property("item.list.$item") ) { .... } } The property mechanism is modelled after the Java implementation of properties. In general, a property is a string value that is associated with a key. A key is a series of names (identifiers) separated with periods. Names are treated case insensitive. Unlike in Java, the properties are really hierarchically organized. This means that for a given property you can fetch the list of its subkeys, and so on. Moreover, the list of subkeys is returned in the order the properties were defined. Property lookup can use a preset property context. If a context ctx has been set using set_context(ctx), get_property(foo.bar) will first try ctx.foo.bar and then foo.bar. get_property(.foo.bar) (note the leading period) will only try ctx.foo.bar and raise an exception if no context was set. Design goals: - properties must be hierarchical of unlimited depth; - manual editing of the property files (hence unambiguous syntax and lay out); - it must be possible to locate all subkeys of a property in the order they appear in the property file(s); - lightweight so shell scripts can use it to query properties. METHODS new new is the standard constructor. new doesnt require any arguments, but you can pass it a list of initial properties to store in the resultant properties object. new clone is like new, but it takes an existing properties object as its invocant and returns a new object with the contents copied. WARNING This is not yet a deep copy, so take care. parsefile file [ , path [ , context ] ] parsefile reads a properties file and adds the contents to the properties object. file is the name of the properties file. This file is searched in all elements of path (an array reference) unless the name starts with a slash. Default path is . (current directory). context can be used to designate an initial context where all properties from the file will be subkeys of. For the detailed format of properties files see below. get_property prop [ , default ] Get the value for a given property prop. If a context ctx has been set using set_context(ctx), get_property(foo.bar) will first try ctx.foo.bar and then foo.bar. get_property(.foo.bar) (note the leading period) will only try ctx.foo.bar and raise an exception if no context was set. If no value can be found, default is used. In either case, the resultant value is examined for references to other properties or environment variables. Such a reference looks like ${name} ${name:default} name can be the name of an environment variable or property. If name is found in the environment, its value is substituted and the expansion process continues, re-examining the new contents, until no further substitutions can be made. If a non-empty value exists for the property name its value is used in a similar way. Hence an empty value for a property will be ignored. If no value can be found, the default string (not to be confused with the default parameter) will be returned. As an additional service, a tilde ~ in what looks like a file name will be expanded to ${HOME}. The method result_in_context can be used to determine how the result was obtained. It will return a non-empty string indicating the context in which the result was found, an emptry string indicating the result was found without context, or undef if no value was found at all. get_property_noexpand prop [ , default ] This is like get_property, but does not do any expansion. gps prop [ , default ] This is like get_property, but raises an exception if no value could be established. This is probably the best and safest method to use. get_property_keys prop Returns an array reference with the names of the (sub)keys for the given property. The names are unqualified, e.g., when properties foo.bar and foo.blech exist, get_property_keys(foo) would return [bar, blech]. expand value [ , context ] Perform the expansion as described with get_property. set_property prop, value Set the property to the given value. set_properties prop1 => value1, ... Add a hash (key/value pairs) of properties to the set of properties. set_context context Set the search context. Without argument, clears the current context. get_context Get the current search context. result_in_context Get the context status of the last search. Empty means it was found out of context, a string indicates the context in which the result was found, and undef indicates search failure. dump [ start [ , stream ] ] Produce a listing of all properties from a given point in the hierarchy and write it to the stream. stream defaults to *STDOUT. dumpx [ start [ , stream ] ] Like dump, but dumps with all values expanded..

Requirements: No special requirements
Platforms: Linux
Keyword: Context File Libraries List Of Mmds Mmdsproperties New Perl Module Properties Properties Perl Property Value Will Be
Users rating: 0/10

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


MMDS::PROPERTIES RELATED
Development Tools  -  Converting a list of equal length lists into XML 1.0
This module takes a list of equal length lists and converts it into XML. If the first sublist is a list of headings, these are used to form the element names of the rest of the data, or these can be defined in the function call. Root and "row"...
 
Miscellaneous  -  A List of Dictionaries 1.0
This  class emulates a list of dictionary objects without the memory and pickle storage overhead which occurs when storing every item in the list as a dictionary.
 
Miscellaneous  -  Transposing a List of Lists 1.0
This script allows you to transpose a list of lists of different lengths.
 
Development Editors  -  DTM ODBC Driver List 2012
DTM ODBC Driver List is a free command line tool that enumerates or export to text file the list of installed ODBC drivers. The text file generated by the tool is ready to open by Microsoft Excel. There are tow output format: brief and full....
21 KB  
Development Editors  -  DTM JDBC Driver List 2012
DTM JDBC Driver List is a free command line tool that enumerates or export to text file the list of installed JDBC drivers. The tool is compatible with Windows, Unix/Linux and MacOS systems. The output file generated by the tool is ready to...
3 KB  
Development Editors  -  DTM ODBC DSN List 2011
DTM ODBC DSN List is a free command line tool that enumerates or export to text file the list of ODBC data source names (DSN). The text file generated by the tool is ready to open by MS Excel. There are two output format: brief and full. Also, it...
20.48 KB  
Screen Savers  -  To Do - Create Check List Of Things To D 1.0
"To Do - Create Check List Of Things To Do's lets you keep track of important tasks and meetings. Do you have trouble remembering the last time you missed you meeting? Checked your credit score? Cooked tonight? With a simple, clean, and elegant...
1.3 MB  
Games  -  New Super Mario Bros Cheats 1.0
A free list of cheats for New Super Mario Bros. Wii, including secrets to unlock: - Easy & infinite lives - Hidden easter eggs - Auto pilot mode - And lots more !...
5.72 MB  
Networking  -  List of references 1.0
Generates a list of links used in a post. This can be used to create a list of references like those in scientific publications. Add [lor] at the end of your post (or wherever you want the list of references) and add a title attribute to all links...
10 KB  
Networking  -  List of Posts from each Category plugin for WordPress 2.0
List of Posts from each Category plugin for WordPressThis plugin displays a list of the posts from each category of your WordPress installation. It can be added to a post or page, or used directly in a template file. In the plugind¬DSdus...
10 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