## ## OSSP var -- Variable Expansion ## Copyright (c) 2001-2002 The OSSP Project (http://www.ossp.org/) ## Copyright (c) 2001-2002 Cable & Wireless Deutschland (http://www.cw.com/de/) ## ## This file is part of OSSP var, a variable expansion ## library which can be found at http://www.ossp.org/pkg/var/. ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED `AS IS' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## ## var_qref.pod: Quick Reference manual page source ## =pod =head1 NAME var_qref -- OSSP var Quick Reference =head1 DESCRIPTION A string expanded through B can consist of arbitrary text characters plus one or more of the following special syntax constructs which are expanded by B. This is just a very brief summary. For more details see var(3). =over 4 =item C<\>I Character with the octal value I (I: C<0>,...,C<7>). =item C<\x>I, C<\x{>IC<}> Character with the hexadecimal value I or the characters denoted by grouped hexadecimal numbers I. (I, I: C<0>,...,C<9>,[C],...,[C]). =item C<\t>, C<\r>, C<\n> Tabulator, Carriage Return and Newline character. =item C<\\>, C<\>I Ordinary character C<\> and I. =item C<$>I, C<${>IC<}> Contents of scalar variable I. =item C<${>IC<[>IC<]>C<}> Contents of array variable I at position I. For I full arithmetic expressions are allowed. =item C<${>IC<:#}> Length of C<$>I. =item C<${>IC<:l}>, C<${>IC<:u}> C<$>I, converted to all lower-case or all upper-case. =item C<${>IC<:->IC<}> If C<$>I is not empty string, then C<$>I, else I (default value). =item C<${>IC<:+>IC<}> If C<$>I is empty string, then empty string, else I (positive alternative). =item C<${>IC<:*>IC<}> If C<$>I is not empty string, then empty string, else I (negative alternative). =item C<${>IC<:o>IC<,>[I]C<}> Substring of C<$>I starting at position I with I characters. =item C<${>IC<:o>IC<->[I]C<}> Substring of C<$>I starting at position I and ending at position I (inclusive). =item C<${>IC<:s/>ICIC[C]C<}> C<$>I after replacing characters matching I with I. By default, case-sensitive regular expression matching is performed and only the first occurance of I is replaced. Flag "C" switches to case insensitive matching; flag "C" switches to plain text pattern; flag "C" switches to replacements of all occurances. =item C<${>IC<:y/>ICIC C<$>I after replacing all characters found in the I character class by the corresponding character in the I character class. =item C<${>IC<:p/>ICIC{C,C,C}C<}> C<$>I after padding to I with I. Original contents of I is either left justified (flag "C"), centered (flag "C"), or right justified (flag "C"). =item C<[>IC<]>, C<[>IC<]>C<{>IC<,>IC<,>IC<}> Repeat expansion of I as long as at least one array variable does not expand to the empty string (first variant) or exactly (I-I)/I times (second variant). In both cases the character "C<#>" is expanded in C as the current loop index (C<0>,... for first variant and I,...,I with stepping I for second variant). I of array variable lookups. For I, I and I, full arithmetic expressions are allowed. =back =head1 SEE ALSO var(3). =cut