In line 30 my ($x, $y, %visited, $word) = @_ you are assigning to a hash. If @_ contains 3|5|7...elements, the first two will go into $x, $y and the rest (odd number) will be assigned to %visited and $word will always be undefined.
You should either put $word before %visited or pass in a hashref.
In reply to Re: Depth First Search and Boggle
by BrowserUk
in thread Depth First Search and Boggle
by smgfc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |