control
Returns the named control field or copies named scratchpad
variable to the current control space.
Summary
| Parameter
|
Description
|
Default
|
| name |
The name of the control variable to set or return. |
None |
| default |
Value to return if the control variable is missing or empty. |
None |
| reset |
Resets the $::Control array by setting a special control variable. |
None |
| set |
Copies named scratch variable to the current control space. |
None |
Examples
Perl example
$Tag->control({
name => 'foo',
default => 'bar',
});
|
or similarly with positional parameters:
|
$Tag->control($name, $default, $attribute_hash_reference);
|
Description
Returns named control field or copies the named
scratchpad variable to the current control space.
Returns value specified by "default" attribute if the control
variable is not defined or is empty.
Calling without a name moves to next element in the
control space array.
Calling without a name and "reset=1" returns to first element
in the control space array.
Parameters
name
The name of control variable to set or return.
default
Value to return if the control variable missing or empty.
reset
Resets the $::Control array by setting special
control variable "control_index" to 0.
The "control_index" is an index into the $::Control
array of hashrefs.
- $::Control is a reference to $Vend::Session->{control}.
- Must not specify name.
- May specify default.
set
Copies named scratchpad variable to the control
space, with the current control space index.
See also