setenv in script

Is it possible to set environement variable in a script (for example, perl script) so that the variable will be set after exiting the script - in a father shell.

No, once the shell that is running your script is ended, so is its environment. However, you could use a common environment file that is sourced before execution of each script. Where I work, all applications run under the application ID, when the sceduler runs, it does so as root and is able to 'su' to the application ID. We have setup the .profile of each application to export a base set of environment variables. So, when root issues the 'su' to the application ID then that base set of variables are set within the shell and are persistent for the duration of the cycle.

It need not be .profile always .....

See the following .....

$ cat x.sh

export a="hello"
export b="world"
$
$
$ unset a ; unset b
$ ./x.sh
$ echo $a $b

$ cp x.sh setup
$ ./setup
$ echo $a $b

$ . ./setup
$ echo $a $b
hello world
$ unset a ; unset b
$ . ./x.sh
$ echo $a $b
hello world
$ unset a ; unset b
$ echo $a $b

$ . ./x.sh
$ echo $a $b
hello world