Undefined

Updated: 04/26/2017 by Computer Hope

Anything that lacks a description or has not been declared is considered undefined. For example, in computer programming if a variable had not been declared when the program or script is run you will receive a "no value", "not defined", "unbound", "undefined" error message.

use strict;
$x = "Example";
print "$x\n";

In the above example, of a Perl program because "use strict;" is used in the script all variables must be declared. Because the $x variable is not declared in the above example, this script would give an error.

use strict;
my $x = "Example";
print "$x\n";

In the above example, the $x variable has been declared by adding "my" in front of the line. Since the variable is now declared and defined this script prints "Example".

NaN, Null, Programming terms, Undefined variable