#!perl -l sub foo { local %ENV; $ENV{foo} = '1'; print $ENV{foo}; } foo; print 'yes' if $ENV{foo} eq '1';