The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IO::Extended - more print functions

SYNOPSIS

  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' );

DESCRIPTION

IO::Extended contains a bunch of print-like functions, which automatically add newline characters to the string.

EXPORT

qw(println printfln) by default.

Use the ':all' for automatically adding the complete set.

VARIABLES

$IO::Extended::space
$IO::Extended::tabsize

Scalars for constructing tabs. Indentation is done via printing space x ( indentation * tabsize ).

FUNCTIONS

printl

Same as normal print, but with indentation.

println

Same as normal print, but adds newline character to the end.

ln

Synonymou to println.

printfln
lnf

Synonymou to printfln.

sprintfl

Same as normal (s)printf, but has some extensions to the FORMAT string.

sprintfln

Same as normal (s)printf, but adds newline character to the FORMAT string (Result).

warnfln

As warn, but accepts a FORMAT string like printfln.

diefln

As die, but accepts a FORMAT string like printfln.

ind( $integer )

Sets the indentation value.

indn

Increases the indentation one value up.

indb

Decreases the indentation on back in its history.

indreset

Sets indentation to zero and resets its history.

tabs( $integer )

Sets the tabsize for indentation. Returns the actual tabsize if parameter is omitted.

indstr

Returns the absolute indentation space.

nl

join ' ', @_ and adds a newline to it. No indentation.

 print nl( "my cool", "text" )

results in

 "my cool text\n"

FORMAT (*printf*)

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

 printfln "Your given string %S is broken.", $string;

[Note] $string could contains confusing whitespaces, for example.

SUPPORT

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.

AUTHOR

Murat Uenalan, muenalan@cpan.org

COPYRIGHT

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.

SEE ALSO

perl(1). perlfunc

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 118:

You forgot a '=back' before '=head1'

Around line 120:

'=item' outside of any '=over'