in reply to using .profile in perl
If you only need to load the environment settings from that file into your Perl program, tilly's RE (tilly) 3: Get default login environment can help you.