in reply to Case insensitive keys in global %ENV
*nix right? If so, then changing %ENV only affects the running program and any children. If that's what you need to do, then that's what you need to do. The only real question is do you need the lowercase (or mixed case) entry to still be around. If not, then something like this works fine:
if you don't mind the *dupes* (not really) entries, then you can simplify even further:foreach my $key ( keys %ENV ) { my $val = $ENV{$key}; delete $ENV{$key}; $ENV{ uc $key } = $val; }
So what's really the problem -- I see no need for something extreme.foreach my $key ( keys %ENV ) { $ENV{ uc $key } = $ENV{$key}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Case insensitive keys in global %ENV
by bdimych (Monk) on Aug 15, 2007 at 13:51 UTC |