in reply to regexp searches over array slices

if(@array[3..4] =~ /\S/) { do stuff; }
is the same as:
if($array[4] =~ /\S/) { do stuff; }
The slice evaluates to the last element. You can try one of these to 'stringify' the array slice first (assuming $" is set to the default):
if("@array[3,4]" =~ /\S/) { or if ("@array[3,4]" =~ tr/ \t\n//c) {