in reply to Re: perl global vars in subroutines
in thread perl global vars in subroutines

Interesting idea, to say the least.

But wouldn't it get terribly mixed up if your script was run more than once at the same time? And don't you have to "clean up" the environment variables when you end your code? What happens if your code --heaven forbid-- crashes halfway through before you can clean the envoironment? Is there a way to reset the environment to its pristine state?

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Re: perl global vars in subroutines

Replies are listed 'Best First'.
Re: Re: Re: perl global vars in subroutines
by coreolyn (Parson) on Feb 16, 2004 at 20:53 UTC

    I only use in non-parallel processed code. As for the ENV itself, when the shell dies the vars die, only code within the created fork and below contain the values.

      I don't know what you're saying, but perl only affects perl, so the enviroment which started perl does not get modified by perl
      E:\>echo %FORK% %FORK% E:\>perl -le"$ENV{FORK}=666;" E:\>echo %FORK% %FORK%