After three days of trying to track down an annoying bug, I finally traced it to this innocuous line, I stripped all the cruft out:
my @t = qw/aA bB cC dD eE fF gG hH iI jJ kK lL mMmM nN oO pP qQ rR sS
+tT uU vV wW xX yY Zz/;
my $x = 0;
$x = length for @t[0 .. 1];
print $x;
What the code is supposed to do is print out "4". Instead it prints out "2". Clearly there is something amiss here.
What I thought the code does is get a slice of @t, loop through the sliced elements in @t, get the length of each one and assign the sum to $x.
I've tweaked this portion of my code for three days and I can't seem to get it behaving right. Ironically, I've actually gotten similar (albeit more convoluted code) actually working in different language. So there is clearly some nuance I'm missing here.