Sorry to be a complete dummy - that doesn't usually stop me! - I understand & agree with your analysis of this script but..... When getenv is run against this file TWO_TASK is omitted and I can't see a reason why. (I removed the semi-colon and it still didn't appear). I am also confused about your Conclusion; I can certainly execute the .profile as a "system" call but I am unaware of a means to access an alias in Perl can this be done or were you referring to UNIX here?
Cheers,
Ronnie