develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24291] Taint checking against the wrong environment

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
October 26, 2003 04:03
Subject:
Re: [perl #24291] Taint checking against the wrong environment
Message ID:
20031026130818.430969f4.rgarciasuarez@free.fr
hv@crypt.org wrote:
> 
> The main question I think is what C< *ENV = \%myenv > should mean:
> either it should act to replace the environment or not, and the
> rest of the core should act appropriately either way. I think in
> principle it would be most useful for it to replace the environment,
> but I accept that that involves a lot of extra code and could also
> make C< *ENV = \%myenv > unexpectedly slow. This implies that eg
> C< local %ENV = ( PATH => $path ) > should also work.

I recently documented in perlsub that C<local *foo> doesn't preserve
magic on $foo, @foo, %foo etc. (perlsub/"Localization of globs").
This feature can be useful when doing C<local *_> in order to
localize $_ _and_ drop all previous magic on $_ that might get in
the way. In other words, C<local %ENV> allows to modify the environment,
while C<local *ENV> does not.

Considering this, I think that a glob assignment to *ENV should drop
the env magic from it, and that the core must be fixed to deal with
it gracefully. That's more consistent with the rest of perl (and the
rest of magical variables.)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About