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.
Alternatively, you can use save_session() with the object-oriented syntax (see
Using Multiple Sessions):
You can use load_session() to load a saved session into the global session as follows: