in reply to Set shell environment variables from within a perl script

environment variables can only be set for the current process, and are passed on to the child processes at fork()/exec().

IOW, your example doesn't work because it executes the export command in a child process (the shell) which then immediately exits.

You probably want something like:

$ENV{CVSROOT} = "something"; system("cvs whatever") and die;

Replies are listed 'Best First'.
Re^2: Set shell environment variables from within a perl script
by johngg (Canon) on May 05, 2008 at 17:26 UTC
    system("cvs whatever") and die;

    I might be wrong but wouldn't exec("cvs whatever"); have the same effect?

    Cheers,

    JohnGG