#!/usr/bin/perl
use strict;
use warnings;
my @needles = ("1-2 Steps", "5-7 Steps", "8-10 Steps", "catch");
my @haystacks = ("move 1-2 steps", "move 8-10 steps to hoist", "catch the ball");
for my $needle (@needles) {
my $found;
for my $haystack (@haystacks) {
if ($haystack =~ /\i\Q$needle\E\i/) {
print "
";
print "Found [$needle] in [$haystack]\n";
print "";
$found++;
}
}
if (!$found) {
print "
";
print "Couldn't find [$needle] anywhere!\n";
print "
";
}
}