First, make sure you realize that lists and arrays are different things; they return different things in scalar context. A list returns its last element, while an array returns its size.
#!/usr/bin/perl -l
## list:
print scalar (4,5,6,7); ## 7
## array:
my @foo = (4,5,6,7);
print scalar @foo; ## 4
Next, understand that an array (or hash) slice is simply a list (see
here for one discussion). In other words, writing
@foo[1,2] is like writing
($foo[1], $foo[2]) explicitly. Yes, it's a bit confusing because the @ sigil is reminiscent of an array...
Now you can see why the array slices didn't compare with == like you thought. The == operator imposes scalar context, which causes the slices to return their last element and the arrays to return their size. If it helps, scatter some print scalar @foo[0,1] statements around to see what numbers really are being compared with == in those conditionals.