in reply to sourcing

If you want the perl script to modify the parent shell's environment, there is a way, but the two processes have to cooperate.

The basic idea is that the subprocess--the perl script--should print shell commands to its stdout, which the parent process--the shell--would capture and execute. For instance, here's a trival script to set your terminal type:

#!/usr/local/bin/perl print "TERM=", $ARGV[0], " export TERM\n";
Run it like this:
eval `myterm vt100`
and your shell will dutifully set its TERM variable to vt100 (assuming you're using a bourne-like shell).

The subprocess may need to look at the SHELL environment variable so that it can produce sh or csh style output as appropriate. And the user wanting to use this command may want to set up an alias or shell function to make the command easier to type.

The unix "resize" command uses this technique. You should take a look at its man page.