in reply to Need help with toy array. THX

if you "use warnings" you should get a message that $toy is used only once. the array @toy is (because of the implementation) (nearly) complete separated from the scalar $toy. a use strict should blow up your code. your parameter passing is logically wrong. you call it with a list and then you take only the first parameter out of it! better: my (@search_for) = @_;. now @search_for has the same entries as @toy. $search_field is nowhere defined. ? for the regex: you could try my $search_for_regex = join "|", @toys; and then search for $search_for_regex. ;) the | is the alternation operator in a regex.