NAME

Meta::Utils::Output - write output messages to console.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

MANIFEST: Output.pm
PROJECT: meta
VERSION: 0.15

SYNOPSIS

package foo;
use Meta::Utils::Output qw();
my($object)=Meta::Utils::Output->new();
my($result)=$object->method();

DESCRIPTION

This is a central controller of output to the console. All output to the console (i.e. what usually you did using stdout and stderr) you should do through this.

this is a SPECIAL STDERR FILE

FUNCTIONS

BEGIN()
print($)
verbose($$)
dump($)
verbose_dump($$)
get_file()
get_handle()
get_block()
set_block($)
TEST($)

FUNCTION DOCUMENTATION

BEGIN()

This is the BEGIN block for this module. It is executed when the module is loaded. Currently it just sets the autoflush on STDOUT which is not so by default. The reason I don't do this for STDERR bacause by default STDERR is already so.

print($)

This prints out an output message to the console.

verbose($$)

This method prints out an output message to the console only if the first parameter is true.

dump($)

This method will dump to out any structure. It used Data::Dumper to do that.

verbose_dump($)

This method will dump a structure only if the verbose flag is turned on. It uses the dump method to do it's thing.

get_file()

This method will return a file handle that other code can write to in order to get output on the console.

get_handle()

This method will return the code handle that other code can write to in order to get output to the console.

get_block()

This will retrieve whether currently printing output is blocked.

set_block($)

This method will set the current blocking attribute.

TEST($)

Test suite for this module.

SUPER CLASSES

None.

BUGS

None.

AUTHOR

Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER

HISTORY

0.00 MV languages.pl test online
0.01 MV get imdb ids of directors and movies
0.02 MV perl packaging
0.03 MV more movies
0.04 MV md5 project
0.05 MV database
0.06 MV perl module versions in files
0.07 MV movies and small fixes
0.08 MV thumbnail user interface
0.09 MV import tests
0.10 MV more thumbnail issues
0.11 MV website construction
0.12 MV web site automation
0.13 MV SEE ALSO section fix
0.14 MV finish papers
0.15 MV teachers project

SEE ALSO

Data::Dumper(3), IO::Handle(3), strict(3)

TODO

-use Text::Wrap here to wrap up lines.

-do colorization.

-do reading of arguments from XML options database and control in here.

-read whether we should do the flushing from the XML options file.

-get rid of the "SPECIAL STDERR FILE" tag here intended to allow using STDERR.

-dont print via STDOUT and therefore don't call autoflush on it. STDOUT is for results and not for messages. Use STDERR which already flushes.

-give out a file handle to /dev/null if it is requested when block is 1.