The timeout just specifies when to interrupt the script. It is not really needed, the default is something like 2 mins, but nice to explicitly define.
For the output of the script, this is how you want to structure it:
(based on this xml metadata)
<filter name="template">
exec:timeout=%timeout%,file=${script},args=-p '%arg%':${alias}
</filter>
<metric name="Metric"
alias="metric"
category="AVAILABILITY"
units="percentage"
indicator="true"
collectionType="dynamic"/>
$ script.pl
metric=.87
another example:
<filter name="template">
exec:timeout=%timeout%,file=${script},args=-p '%arg%':foo.${alias}
</filter>
<metric name="Metric"
alias="metric2"
category="AVAILABILITY"
units="MB"
indicator="true"
collectionType="dynamic"/>
$ script.pl
foo.metric2=8192