Update gtrans.pl

add perldoc, refactor code