Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Falsey.
- ?0 == False or die "Wrong state"; # Zero.
- ?0.0 == False or die "Wrong state"; # Zero (as float).
- ?"" == False or die "Wrong state"; # Empty string.
- ?() == False or die "Wrong state"; # Empty list.
- ?{} == False or die "Wrong state"; # Empty hash.
- ?Nil == False or die "Wrong state"; # Nil
- my $v; ?$v == False or die "Wrong state"; # Undefined variable.
- # Truthy: all non-falsey values.
- ?1 or die "Wrong state";
- ?1.0 or die "Wrong state";
- ?"Hello World" or die "Wrong state";
- ?(1, 2, 3) or die "Wrong state";
- ?{"one" => "eins", "two" => "zwei", "three" => "drei"} or die "Wrong state";
- my $u = 99; ?$u or die "Wrong state";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement