Hub::Parse::Parser -
Part of the Hub Library
Usage: new
Constructor.
Usage: populate \HASH+
Populate our template with provided variable definitions.
PARAMETERS:
\HASH Variable name to definition map
Example: This example:
my $parser = mkinst( 'Parser', -template => 'Hello ' );
matches:
Hello World
Usage: refresh
Return instance to initial state.
Usage: tweaker \$value, $tweak+
Tweaks allow modification to variable values. This is expensive, and hence should be used only as a last resort.
No spaces are allowed in the tweak name!
Variables have to be specified as {#name} (not ) because of the use of s/name/value/g in the main populate routine.
Implemented tweaks:
! # Run command (custom tweak) tr/// # transliterates search chars with replacement chars lc # lower case uc # upper case lcfirst # lower case first letter ucfirst # upper case first letter x= # repeat the value so many times esc # escape non-word characters html # replace '<' and '>' with '<' and '>' num # number (will use zero '0' if empty) dt(opts) # datetime with options (see datetime). dhms(opts) # day/hour/min/sec with options (see dhms). eq # equal ne # not equal gt # greater than lt # less than if # is greater than zero (or non-empty string) - # minus + # plus * # multiply / # divide % # mod
Get a value from the current values array
Usage: _populate [OPTIONS], \HASH+
Internal worker function.
Recursive.
OPTIONS:
-text \SCALAR Template text to populate
Usage: _tweak
Internal function.
Tweak values.
Subroutine for tweaking must be provided in the constructor.
Ryan Gies
Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.
Copyright (c) 2000-2005 Ryan Gies. All rights reserved.
This file created by on at
To install Hub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hub
CPAN shell
perl -MCPAN -e shell install Hub
For more information on module installation, please visit the detailed CPAN module installation guide.