in reply to Strange "Useless use of constant" message: should not appear at all!

Perhaps you should run this:
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";
Then read up on == working on numerical values :)

cLive ;-)

  • Comment on Re: Strange "Useless use of constant" message: should not appear at all!
  • Download Code