"Sputnik" help  
Sputnik Help
Language Reference - Operators - Operator ~ (Bitwise Not)

Operator ~

BitwiseNOT. e.g.

my $var = ~5;
say $var;
// Result is -6 because for 32-bit numbers
// 5 == 00000000000000000000000000000101 binary
// -6 == 11111111111111111111111111111010 binary
// and the first bit is signed

Flip a bool:

my $bool = true;
say ~$bool; // Flip a bool
// PRINTS
// false

This can be used to flip an if statement:

// Set a string to parse
my $str = "Cat"; 
if(~($str == "Dog"))
{
    say "String is NOT a dog";
}
else
{
    say "String is dog";
}
// PRINTS
// String is NOT a dog

To see a list of all the operators go here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org