What I can think of why it is changed: The agent needs a specific PERL version. During the agent installation it will be set or altered, if the PERL5LIB system environment variable is an older version, to the correct (according to the agent) PERL5LIB system environment variable.
I take you already use perl for an other purpose and this will not work with the Agent perl version?
If you use your Perl application manually (= not as a service) would it be an option to first set the PERL5LIB pointing to the old Perl directories.
An other option would be to delete PERL5LIB as a system environment variable and set it as an user environment variable for two accounts. Here you also have to change the Agent service to run under one of the accounts.
But if this works for the agent I don't know