Example: (please ignore the fact that this code doesn't really do anything, it's meant to illustrate the warning messages only)
Does anyone know why there are different numbers of warnings? (We expect one warning per number that gets thrown away within the list)#!/usr/bin/perl -w use strict; # Why the inconsistency with warning messages? my @movement = (0,1,2,3,4); my $from = ""; if (@movement == (0,1,2)) {$from = "012"} # no warning if (@movement == (1,2,3)) {$from = "123"} # 1 warning if (@movement == (2,3,4)) {$from = "234"} # 2 warnings if (@movement == (3,4,5)) {$from = "345"} # 2 warnings if (@movement == (-0,-1,-2)) {$from = "012"} # 1 warning if (@movement == (-1,-2,-3)) {$from = "123"} # 2 warnings if (@movement == (-2,-3,-4)) {$from = "234"} # 2 warnings if (@movement == (-3,-4,-5)) {$from = "345"} # 2 warnings if (@movement == (0,1,0,1)) {$from = "0101"} # no warning if (@movement == (1,2,1,2)) {$from = "1212"} # 1 warning if (@movement == (2,3,2,3)) {$from = "2323"} # 3 warnings if (@movement == (3,4,3,4)) {$from = "3434"} # 3 warnings
Does this affect anything that I do in my daily coding life? Not likely, I just wanna know 'cause I'm curious.
Sandy
UPDATE
Thanks to all the posters below. It's these little details that make learning stuff all the more interesting.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |