SPVM::Bool - Bool object
use Bool; my $true = Bool->TRUE; my $false = Bool->FALSE; my $true_value = $true->value; my $false_value = $false->value;
Bool object stores a long value.
long
This object is immutable and its value cannot be changed.
Bool is automatically loaded just after the program starts.
static method TRUE : Bool ();
A true singleton. This is created by INIT block when the program start.
static method FALSE : Bool ();
A false singleton. This is created by INIT block when the program start.
method value : int ();
Returns a int value.
int
If Bool object express true, this method return 1.
1
If Bool object express false, this method return 1.
the object of Bool class is different behavior in bool context.
If the value of Bool object is 1, it is evaluated as true.
value
if (Bool->TRUE) { # Run }
If the value of Bool object is 0, it is evaluated as false.
if (Bool->FALSE) { # Not run }
true keyword means Bool->TRUE. false keyword means Bool->FALSE.
true
false
if (true) { # Run } if (false) { # Not run }
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.