use strict; use warnings; use Text::SpellChecker; ($Text::SpellChecker::pre_hl_word, $Text::SpellChecker::post_hl_word) = (qw([ ])); my $checker = Text::SpellChecker->new(text => "Foor score and seven yeers ago"); while (my $word = $checker->next_word) { print $checker->highlighted_text, "\n", "$word : ", (join "\t", @{$checker->suggestions}), "\nChoose a new word : "; chomp (my $new_word = ); $checker->replace(new_word => $new_word) if $new_word; } print "New text : ".$checker->text."\n";