Text::OutdentEdge - remove indent chars.


Text-OutdentEdge documentation  | view source Contained in the Text-OutdentEdge distribution.

Index


NAME

Top

Text::OutdentEdge - remove indent chars.

VERSION

Top

Version 0.01

SYNOPSIS

Top

 use Text::OutdentEdge qw(xoutdent);

 print <<INDENT, xoutdent <<XOUTDENT;
   Hello, World!
 INDENT
   X Hello, Edged-Outdent!
 XOUTDENT
 # ==> print "  Hello, World!\n", "Hello, Edged-Outdent!\n";

EXPORT

Top

This Module can export two function.

FUNCTIONS

Top

xoutdent

 my $text = xoutdent $in;
 my $text = xoutdent $in, $opts;

This function removed edged-indent. For example:



 print xoutdent <<TEXT;
   X Hello,
   X World!
 TEXT

just prints two words, "Hello" and "World!" on each lines.

This function take two arguments. First one is target text which may be indented. Second one is optional hash-ref. Options are:

indent => $regexp

specifies what are removed. Default is qr/[ \t]+/;

xchar => $regexp

specifies edge-string regexp. Default is qr/\S([ \t]|$)/;

chomp => $flag

specifies whether chomp result text. Default is false.

trim => $flag

specified whether trimming spaces of multiline q{..}. Default is true.

outdent

 my $text = outdent $in;
 my $text = outdent $in, qr/^ {4}/;
 my $text = outdent $in, $opts;

This function take two arguments. This function is same as:



 xoutdent $in, { %$opts, indent => minimum-indent, xchar => '', }

If regexp is passed as second argument, it treated as { indent = $regexp, xchar => '', }>.

AUTHOR

Top

YAMASHINA Hio, <hio at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-text-outdentedge at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-OutdentEdge. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.



    perldoc Text::OutdentEdge

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Text-OutdentEdge

* CPAN Ratings

http://cpanratings.perl.org/d/Text-OutdentEdge

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-OutdentEdge

* Search CPAN

http://search.cpan.org/dist/Text-OutdentEdge

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Text-OutdentEdge documentation  | view source Contained in the Text-OutdentEdge distribution.