perl -p -i.bak -e "s/^-//g" foo.dat #### perl -p -i.bak -e "s/^-(.*)/uc($1)/e" foo.dat