NAME

perldemo2 - a newer example of a HEAdas Perl script

USAGE

perldemo2 infile=<filename> outfile=<filename> text=<string> chatter=<integer(0-5)> scale=<real number> clobber=<boolean> history=<boolean>

DESCRIPTION

This is a simple Perl script which is designed to demonstrate how to use the new Perl modules in writing a HEAdas script. Modules now exist to allow developers to directly call routines from the CFITSIO, PIL, heainit, and heautils libraries. This gives scripts virtually identical functionality to compiled tools. Running this tool isn't particularly instructive since all it does is copy a FITS file. Reading the code, hopefully, is useful!

PARAMETERS

infile [filename]
Filename-type parameter. Will be copied to outfile.

outfile [filename]
Filename-type parameter. Destination for copy of infile.

text [string]
String-type parameter.

scale [real]
A real number parameter.

(chatter = 1) [enumerated integer]
Standard HEAdas chatter parameter. A range of 0 to 5 is enforced by the min and max fields in the parameter file.

(clobber = no) [boolean]
Standard HEAdas clobber parameter, used here as an example of a (hidden) boolean parameter.

(history = yes) [boolean]
Standard HEAdas history parameter. If set to "yes" then a block of HISTORY keywords encapsulating the runtime parameter values will be written in any FITS file specified via the HDpar_stamp() routine available in the HEACORE::HEAUTILS module.

EXAMPLES

The following examples illustrate the use of perldemo2 (though it does nothing useful).

1. run perldemo2, prompting for all required parameters:

      perldemo2
2. run perldemo2 specifying all parameters:

      perldemo2 infile=myfile.fits outfile=yourfile.fits text='Hello!' scale=3.14159 chatter=5 clobber=yes history=yes

SEE ALSO

perldemo (the original demo Perl script which doesn't use the PIL wrappers or other modules)

LAST MODIFIED

April 2004