Puma::Util - various stand-alone utilities
use Puma::Util qw( splithash mergehash quote );
Puma::Util provides a number of stand-alone utility functions. Most of these functions do not have any direct dependancy on Puma per se, but add greatly to the value of the package my making a number of common functions quite easy.
This package encapsulates miscellaneous functions that do not fit into the Puma::Util:: subpackages.
splithash takes HASHREF, removes the key/value pairs listed in KEYARRAY and returns a new HASHREF with the extracted keys.
It will not create any keys that did not previously exist or were undefined.
This function returns a new hash consisting of the merged contents of all given HASHREFs. The HASHREFs that are later in the list will override any matching values in earlier HASHREFs.
merghash returns an entirely new hash and does not modify the original hashes or any hashes within them.
N.B. These functions may be moved to Puma::Util::Hash (or some similar class) some time in the future.
This functions attempts to find a unique quotation delimeter (qq) for STRING. It will search through STRING for various forms of delimeters and attempt to use a delimeter not contained in the string. If a suitable delimeter could not be found, it will use an arbitrary quotation delimeter and escape out any instances of conflicting delimeters.
If quote receives more than one parameter, it will concatentates all parameters into a single string before processing.
Copyright (c) 2001, 2002 by Ingmar Ellenberger.
Distributed under The Artistic License. For the text of this license, see http://puma.site42.com/license.psp or read the file LICENSE in the root of the distribution.