perl: static map -> rand map; minor indent fix
perl: "." -> "Esc" for exit