> -----Original Message----- > From: Harter, Douglas [mailto:[EMAIL PROTECTED] > Sent: Friday, October 17, 2003 8:09 AM > To: Beginners Mailing List Perl (E-mail) > Subject: alias in the shell > > > Is it possible to create an alias in the shell from within Perl? > > I have a command I want to use in the shell after my Perl > script executes. This command can vary, so what I would > prefer to do is set up an alias to execute it. > > I realize aliases are created differently in different > shells. I will be using Bourne. > > So far I have tried using system("alias name=xxx") > and creating a scipt with the same command in it and > executing it thru system. > > Neither worked, since I could not see the new alias by doing > alias >
There is no way I know of for a child process to modify the environment of it's parent. You might try having your perl program create a script somewhere in the path, then the parent could execute it. You can also get tricky by running your perl script in the current environment using: . program_name (space after the dot) then your program could exit using exec('path/to/shell'); -Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]