in reply to Re: Re: Unexpected die
in thread Unexpected die

Having thought a little more about this (and pondering the other replies)... how about this (untested):

The point is that, as far as .profile is concerned, the environment settings are always provided by the same file that it finds in each person's $HOME; you just need the perl script to allow people to control what that file contains (or what it points to) at login time.

This might have a nice side effect: folks who want to use the same environment file as last time could just reply to the perl script with an empty line (just hit <return>). The perl script only needs to create a new one when the user specifies a particular choice (or when the user doesn't have a .chosen_env yet).