$ echo 'Applying pattern match to @array will act on scalar(@array) at e.pl lin e 29'|splain|fmt Applying pattern match to @array will act on scalar(@array) at e.pl line 29 (#1) (W misc) The pattern match (//), substitution (s///), and transliteration (tr///) operators work on scalar values. If you apply one of them to an array or a hash, it will convert the array or hash to a scalar value -- the length of an array, or the population info of a hash -- and then work on that scalar value. This is probably not what you meant to do. See perlfunc/grep and perlfunc/map for alternatives.