misc perl and shell scripts