IO::Extended - more print functions
use IO::Extended ':all'; printl 'foo bar'; println 'foo bar'; ln "foo bar"; printfln 'foo %s', 'bar'; $str = sprintfln 'foo %s', 'bar'; warnfln 'foo %s', 'bar'; diefln 'foo %s', 'bar'; tabs 5; ind 1; indn; print indblock( "alpha\nbeta\ngamma\n" ); indb; indstr; nl( 'string' );
IO::Extended contains a bunch of print-like functions, which automatically add newline characters to the string.
qw(println printfln) by default.
Use the ':all' for automatically adding the complete set.
Scalars for constructing tabs. Indentation is done via printing space x ( indentation * tabsize ).
space x ( indentation * tabsize )
Same as normal print, but with indentation.
Same as normal print, but adds newline character to the end.
Synonymou to println.
Synonymou to printfln.
Same as normal (s)printf, but has some extensions to the FORMAT string.
Same as normal (s)printf, but adds newline character to the FORMAT string (Result).
As warn, but accepts a FORMAT string like printfln.
warn
As die, but accepts a FORMAT string like printfln.
die
Sets the indentation value.
Increases the indentation one value up.
Decreases the indentation on back in its history.
Sets indentation to zero and resets its history.
Sets the tabsize for indentation. Returns the actual tabsize if parameter is omitted.
Returns the absolute indentation space.
join ' ', @_ and adds a newline to it. No indentation.
print nl( "my cool", "text" )
results in
"my cool text\n"
Barely all format is forwared to the perl internal printf like functions, but one is translated.
%S or %D in the format string will get translated to '%s' or '%d'. It should help writing
'%s'
'%d'
printfln "Your given string %S is broken.", $string;
[Note] $string could contains confusing whitespaces, for example.
$string
By author. Ask comp.lang.perl.misc or comp.lang.perl.module if you have very general questions.
If all this does not help, contact me under the emailadress below.
Murat Uenalan, muenalan@cpan.org
Copyright (c) 1998-2002 Murat Uenalan. Germany. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
perl(1). perlfunc
2 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
'=item' outside of any '=over'
To install IO::Extended, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Extended
CPAN shell
perl -MCPAN -e shell install IO::Extended
For more information on module installation, please visit the detailed CPAN module installation guide.