Removes the common leading whitespaces for each line. Currently lines with only whitespaces are ignored and left untouched; treated as blank lines if you like. No tab expansion is being performed; a tab is just a whitespace character.
If the indention consists of both spaces and tabs then its a good idea to expand the tabs first, see &expand_leading_tabs. If the mix of tabs and spaces is consistent, e.g. every line begins with \t , then that is recognized as indention.
|outdent_all($str)||Like &outdent except it doesnt treat whitespace lines as blank lines.|
Like &outdent but with some twists to make it smooth to use a (possibly indented) quote operator spanning over several lines in your source. The arrows (that isnt part of the code) below point out the two issues this function takes care of.
First, all whitespaces uptil the first newline plus the newline itself are removed. This takes care of the first issue.
Second, if the string ends with a newline followed by non-newline whitespaces the non-newline whitespaces are removed. This takes care of the second issue.
These fixes serve to make the quote operators semantics equivalent to a here-docs.
|expand_leading_tabs($tabstop, $str)||Expands tabs that on a line only have whitespaces before them. Handy to have if you have a file with mixed tab/space indention.|
Johan Lodin <email@example.com>
Copyright 2004-2005 Johan Lodin. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||TEXT::OUTDENT (3)||2005-07-23|