6.5

Table Of Contents
VMware, Inc. 43
Chapter 4 vSphere SDK for Perl Subroutine Reference
Valueoftheoption,aspassedtothescript
Undefifnoneoftheabovearespecified
option_is_set
Checkswhetheranoptionhasbeenexplicitlysetbyascriptorfromthecommandlineorwhethertheoption
hasadefaultvalueorcomputedvalue(returnvalueofafunc).
Parameters
Returns
Boolean.Returns1(true)iftheoptionvaluehasbeenexplicitlyset.Returns0(false)ifthe
optionvalueisa
defaultvalue,isnull,orhasnotbeenexplicitlyset.ForadiscussionofBoolean,see“vSphereSDKforPerl
ProgrammingConventions”onpage 11.
parse
Readsoptionsfromthecommandline,anenvironmentvariable,oraconfigurationfileandtransformsthe
optionintoappropriatedatastructuresforvalidation.
Parameters
Noparameters.
Returns
Returnsnothing.Displaysanerrormessageandquitsiftheparseoperationisnotsuccessful.Ifyouwantto
useaconfigurationfile,callOpts::get_config()
tomakesurethefilecanbeopened.See
“Opts::get_config()”onpage 40.
validate
Ensuresthatinputvalues(fromthecommandline,anenvironmentvariable,oraconfigurationfile)are
complete,consistent,andvalid.
Parameters
Noparameters.
Returns
Returnsnothing.Itdisplaysanerrormessageandquitsiftheparseoperationisnotsuccessful.
usage
Displaysthehelptextmessage.
Parameters
Noparameters.
Returns
Returnsnothing.
Subroutines in the Util Package
TheUtilpackageincludesthefollowingsubroutines:
Parameter Description
option_name Stringvalueofthebuiltinorcustomoption.