or download this
$line = " Jack and jill went up the hill to fetch a pail of water. Jac
+k fell down and broke his crown and jill came tumbling after.";
...
$newline =~ s/(\b$currword(?:ed|ing|al)?\b)/\\footnote\{$1 $hash{l
+c($1)}{explanation}\}/im;
}