Nick Stokoe > Text-Glob-Expand-v0.1.0 > Text::Glob::Expand::Permutation

Download:
Text-Glob-Expand-v0.1.0.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Text-Glob-Expand-1.1.1

NAME ^

Text::Glob::Expand::Permutation - describes one possible expansion of a glob pattern

SYNOPSIS ^

This is an internal class, returned in the which you won't normally create as a user. Text::Glob::Expand->explode returns an arrayref containing objects of this class.

It can be used to get the permutation text, or a formatted version of the permutation's components.

   ($first, @rest) = Text::Glob::Expand->parse("a{b,c}");
   print $first->text;
   # "ab"

   print $first->expand("text is %0 and first brace is %1"); 
   # "text is ab and first brace is b"

INTERFACE ^

$str = $obj->text

Returns the unembellished text of this permutation.

$str = $obj->expand($format)>

Returns the string $format expanded with the components of the permutation.

The following expansions are made:

%%

An escaped percent, expands to %

%0

Expands to the whole permutation text, the same as returned by ->text.

%n

(Where n is a positive decimal number.) Expands to this permutation's contribution from the nth brace (numbering starts at 1).

This may throw an exception if the number is larger than the number of braces.

%n.n

(Where n.n is a sequence of positive decimal numbers, delimited by periods.) Expands to this permutations contribution from a nested brace, if it exists (otherwise an error will be thrown).

So, for example, %1.1 is the first nested brace within the first brace, and %10,3,2 is the second brace within the third brace within the 10th brace.

DIAGNOSTICS ^

TDB

AUTHOR ^

Nick Stokoe <npw@cpan.org>

LICENCE AND COPYRIGHT ^

Copyright (c) 2011, Nick Stokoe <npw@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY ^

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

syntax highlighting: