in reply to the end of a word

$directory =~ s/. \t*\;$/ \;/; the space and the tabs need to be enclosed in square braces . not able to get the formatting rigth