Mar 25, 2004 #1 Crusader2 Technical User Joined Dec 29, 2002 Messages 11 Location EE I have a massive of words...like @massive and a simple $word scalar...how to check if there's a word in that massive which equals @word?
I have a massive of words...like @massive and a simple $word scalar...how to check if there's a word in that massive which equals @word?
Mar 25, 2004 #2 byleth Programmer Joined Feb 27, 2004 Messages 70 Location PT if (grep ({$_ eq $word} @massive)) { print "Found\n"; } else { print "Not found\n"; } but you should probably use a hash... %massive Upvote 0 Downvote
if (grep ({$_ eq $word} @massive)) { print "Found\n"; } else { print "Not found\n"; } but you should probably use a hash... %massive