Astro-IRAF-CL
view release on metacpan or search on metacpan
Note that some IRAF commands are overloaded in this module, for example, set() and show(). This allows the commands to be extended or made more Perl like, in general overloading commands may be a bad idea but for simple things like variable control i...
=head2 Error/Exception handling
As can be seen from the exec() example above references to subroutines can be passed in to deal with any problems that are encountered on execution of the command. A maximum run time (timeout) can be specified and a handler to deal with the timeout, ...
=over 4
=item *
B<Timeout handling>
By default a script will die upon timeout, this can be modified in anyway you like to keep the script going and handle the exception cleanly, an example of a handler is:
my $timed_out = 0;
$iraf->exec(command => 'print "hello"',
timeout => 2,
timeout_handler => sub {print $command . " timed out\n"; $timed_out = 1});
The script can then see from the $timed_out variable that the timeout has occured and can clean up accordingly and move on. Here i have used an anonymous subroutine instead of a reference to a subroutine as it is fairly small.
( run in 0.268 second using v1.01-cache-2.11-cpan-4d50c553e7e )