Astro::FITS::CFITSIO::Simple::PrintStatus - generate a progress status update
INTERNAL USE ONLY! No warranty, may change, etc.
$status = Astro::FITS::CFITSIO::Simple::PrintStatus->new( $what );
Create a new object. $what may be one of the following:
$what
If this is non-zero, a progress indicator is written to STDERR. If Term::ProgressBar is available, that is used, else a simple percentile is output. If this is zero, returns undef.
If it's a glob, it's assumed to be a filehandle glob, and output is written to that filehandle.
If it's a code reference, it is called with three arguments
rows read total number of rows
If it's an object, and it has print() and flush() methods, it'll call those as appropriate.
$status->start( $nrows );
This preps the output and indicates the number of rows that will be written.
$status->update( $rows_read );
This will cause output to be generated. It returns the number of rows that will cause an actual change in the output. It is usually used as such:
$next_update = 0; $ps->start(); for ( 0..$nmax ) { # do stuff $next_update = $ps->update( $_ ) if $_ >= $next_update; } $ps->finish if $nmax >= $next_update;
$status->finish;
This should be called after all of the rows have been written.
1;
To install Astro::FITS::CFITSIO::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::FITS::CFITSIO::Simple
CPAN shell
perl -MCPAN -e shell install Astro::FITS::CFITSIO::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.