How do you implement Jobs with Perl?
Where can I get the Perl libraries for the Job Schedule API? There is a package main, do I get that with JobScheduler download or do I have to go to CPAN?
It depends on the operating system:
- for Windows we do not distribute a library but use the scripting libraries from an existing ActiveState Perl implementation, see http://www.activestate.com.
- for Unix the library
libsosperlscript.soshould have been copied to the
libdirectory by the installer. Moreover the
libperl.so32Bit library from your Perl installation must be linked in the
cd /[JobScheduler installation]/lib/ ln -s /usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/libperl.so libperl.so
Keep in mind that:
- you could use
<job><process file="my_script.pl"/></job>to use Perl as from the command line (
my_script.plmust be executable). This works with all versions of Perl, but no API methods of JobScheduler can be used.
- you would use
<job><script language="perlscript"><include file="my_api_script.pl"/></job>for a Perl script that makes use of JobScheduler API and requires the above libraries for Unix.
The API documentation is available:
- via the built-in JobScheduler Operations Center interface (JOC)
- at http://www.sos-berlin.com/doc/en/scheduler.doc/api/api-perl.xml
There is no such thing as a JobScheduler package for Perl as JobScheduler exposes its objects and methods directly, just use
# to make the object variables available ... use vars qw ($spooler $spooler_log $spooler_job $spooler_task); # ... then use the objects and methods, e.g to access a job parameter $spooler_task->params->value("request_stylesheet")
Some more complete examples of Perl jobs are given in the Solutions Pages of this site, see: