The vSphere SDK for Perl library includes several subroutines that save and reuse sessions, so you can maintain sessions across scripts.
Using sessions can enhance security: Instead of storing passwords in scripts, you can run the Vim::login() subroutine in your script using the name of the session file. The session file does not expose password information.