-
Notifications
You must be signed in to change notification settings - Fork 2
_undef
bergsma edited this page Sep 26, 2014
·
5 revisions
#undef
###The undef function undefines a variable.
Syntax
status = undef variable ;
Arguments
- list variable
A valid identifier.
Return Value
str status
- $ACKNOWLEDGE : The variable was undefined.
The STATUS variable is set to $ACKNOWLEDGE
str status
- $ACKNOWLEDGE : The variable was undefined.
The STATUS variable is set to $ACKNOWLEDGE
Exceptions
-
%ARGUMENT: Invalid arguments. Usage: status = undef variable ;
-
%IDENTIFIER: 'variable' argument is not a valid identifier, literal, or reference
Description
A variable can be undefined with the undef() function. If in local scope, and both a local and global variable of the same name exist, then undef() will delete the local variable first. If in global scope, and both a local and global variable of the same name exist, then undef() will delete the global variable.
Examples
a = 1 ;
if ( exists a )
puts “’a’ exists” ;
undef a ;
if ( !exists a )
puts “’a’ exists not
Related Links