JobDescription(3pm) | User Contributed Perl Documentation | JobDescription(3pm) |
Globus::GRAM::JobDescription - GRAM Job Description Globus::GRAM::DefaultHandlingJobDescription - GRAM Job Description with relative path handling
use Globus::GRAM::JobDescription; $hash = { executable => [ '/bin/echo' ], arguments => [ 'hello' ] }; $description = new Globus::GRAM::JobDescription($filename); $description = new Globus::GRAM::JobDescription($hash); $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') )
When the library_path RSL attribute is specified, this object modifies the environment RSL attribute value to append its value to any system specific variables.
$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.
$description->get('attribute')
will return the appropriate attribute in the JobDescription by name.
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]));
2020-12-12 | perl v5.16.3 |