[Vienna-pm] export enviroment vars

josef schmid e9427749 at stud4.tuwien.ac.at
Wed Sep 2 10:52:27 PDT 2009


Hallo, allerseits!


Mir ist da (zumindest für mich) seltsames aufgefallen.

perl -e '$ENV{foo}=q{bla}; exec q{echo $foo >&2};'¹⁺²
bla # was ich erwarte

perl -e 'local %ENV;$ENV{foo}=q{bla}; exec q{echo $foo >&2};'
bla # was ich auch erwarte

perl -e 'local *ENV;$ENV{foo}=q{bla}; exec q{echo $foo >&2};'
# bäng, nix.


pfiateng,
   Josef



ad 1) Voraussetzung man hat ein Derivat einer Bourne·Shell als
       Standard Shell.
ad 2) das selbe gilt für system(…), open(…,'|…'), sowohl
       unter 5.8.8 als auch 5.10.0


More information about the Vienna-pm mailing list