Globus::GRAM::JobDescription - GRAM Job Description
use Globus::GRAM::JobDescription;
$description = new Globus::GRAM::JobDescription($filename); $executable = $description->executable(); $description->add($new_attribute, $new_value); $description->save(); $description->save($filename); $description->print_recursive($file_handle);
This object contains the parameters of a job request in a simple object wrapper. The object may be queried to determine the value of any RSL parameter, may be updated with new parameters, and may be saved in the filesystem for later use.
$description = { executable => [ '/bin/echo' ], arguments => [ 'hello', 'world' ], environment => [ [ 'GLOBUS_GRAM_JOB_CONTACT', 'https://globus.org:1234/2345/4332' ] ] };
which corresponds to the rsl fragment
&(executable = /bin/echo) (arguments = hello world) (environment = (GLOBUS_GRAM_JOB_CONTACT 'https://globus.org:1234/2345/4332') )
@description->add('new_attribute', $new_value)
will create a new attribute in the JobDescription, which can be accessed by calling the $description-new_attribute>() method.
If the attributes does not in this object, then undef will be returned.
In a list context, this returns the list of values associated with an attribute.
In a scalar context, if the attribute's value consist of a single literal, then that literal will be returned, otherwise undef will be returned.
For example, from a JobDescription called $d constructed from a description file containing
{ executable => [ '/bin/echo' ], arguments => [ 'hello', 'world' ] }
The following will hold:
$executable = $d->executable() # '/bin/echo' $arguments = $d->arguments() # undef @executable = $d->executable() # ('/bin/echo') @arguments = $d->arguments() # ('hello', 'world') $not_present = $d->not_present() # undef @not_present = $d->not_present() # ()
To test for existence of a value:
@not_present = $d->not_present() print "Not defined\n" if(!defined($not_present[0]));