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 30.073.528 Times

MMDS::Properties 1.902

  Date Added: September 25, 2010  |  Visits: 555

MMDS::Properties

Report Broken Link
Printer Friendly Version


Product Homepage
Download (76 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
MMDS::PROPERTIES RELATED
Libraries  -  File::Next::OO 0.04
File::Next::OO is a Perl module with file-finding iterator Wrapper for File::Next::files function. SYNOPSIS File::Next::OO is just a wrapper around File::Next::files function. But it is easy to remember and less typing. Call it always with...
8.19 KB  
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  
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  
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.
 
Libraries  -  ExtUtils::Manifest 1.51
ExtUtils::Manifest is a Perl module that contains utilities to write and check a MANIFEST file. SYNOPSIS use ExtUtils::Manifest qw(...funcs to import...); mkmanifest(); my @missing_files = manicheck; my @skipped = skipcheck; my...
17.41 KB  
Libraries  -  Class::Meta::Declare 0.04
Class::Meta::Declare is a Perl module deprecated in favor of Class::Meta::Express. SYNOPSIS This was a first attempt at making a saner interface for Class::Meta. It is nicer, but Class::Meta::Express is nicer still. Go use that one. package...
15.36 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.12.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