in reply to Strange "Useless use of constant" message: should not appear at all!
Then read up on == working on numerical values :)my @movement = (0, 1); my $from = ""; if (@movement == (0, 1)) {$from = "north"} elsif (@movement == (1, 0)) {$from = "east"} elsif (@movement == (0, -1)) {$from = "south"} elsif (@movement == (-1, 0)) {$from = "west"} print "$from\n";
cLive ;-)
|
|---|