in reply to (Golf) Word Search Solver

177 characters, returning (X-pos, Y-pos, X-dir, Y-dir):

sub find { (*g,$w,$h,$_)=@_;@w=/./g;for$y(0..$h){for$x(0..$w){for$Y(-1..1){for$X( +-1..1){map$Y|$X&&($q=$y+$_*$Y)>=0&($p=$x+$_*$X)>=0&&$w[$_]eq$g[$q][$p +]||next,0..$#w;return$x,$y,$X,$Y}}}}$, }