in reply to match a word in an words' array

You could use grep:
sub addfor{ my ($mainwidget,$entryVariable) = @_; unless (grep { $_ eq $entryVariable } @history) { $widget{'forwardlistbox'}->insert(end => $entryVariable); push @history, $entryVariable; } }
This will be slower than necessary since it will keep testing after $entryVariable is found. A faster version could use first() from List::Util:
use List::Util 'first'; sub addfor{ my ($mainwidget,$entryVariable) = @_; unless (first { $_ eq $entryVariable } @history) { $widget{'forwardlistbox'}->insert(end => $entryVariable); push @history, $entryVariable; } }
Note that your code may have problems: I don't see where @history is getting initialized and you're not using $mainWidget in the subroutine. I don't know if these are real problems or not but they might be.

-sam