#!/usr/bin/perl while (<>) { chop; $a=substr($_,(length($_)-1)); s/[ \-\.,'" ]//g; print "\L$_"; if ($a eq " ") {print " ";} }