Undefined

Updated: 04/26/2017 by Computer Hope

Anything that lacks a description or is not declared is considered undefined. For example, in computer programming, if a variable is not 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 example above of a Perl script, because "use strict;" is used in the script, all variables must be declared. Because the $x variable is not declared in the example above, this script would give an error.

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

In the example above, the $x variable is 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