Subject: | Can't handle multi-line ENV values |
Trying to debug this, I found that it reads the output of "env" linewise.
This however gets confused when there's an env-var called "TIMEFORMAT" with the value of
TIMEFORMAT=
real %3lR
user %3lU
sys %3lS
cpu %P%%
This is uh, a problem:
env -i /usr/bin/perl -E '$ENV{FOO}="foo\nBAZ=quux"; system(q[env])'
FOO=foo
BAZ=quux
env -i /usr/bin/perl -E '$ENV{FOO}="foo\nBAZ=quux"; system(qw(perl -MData::Dumper=Dumper -E), "say Dumper(\\%ENV)")'
$VAR1 = {
'FOO' => 'foo
BAZ=quux'
};
Which means "env" is not a reliable way to read the environment values.
So subsequently:
Parsed ENV: 'LC_CTYPE=en_NZ.UTF8' => 'LC_CTYPE' => 'en_NZ.UTF8'
Parsed ENV: 'QT_XCB_NO_XI2_MOUSE=1' => 'QT_XCB_NO_XI2_MOUSE' => '1'
Parsed ENV: '_system_name=Gentoo' => '_system_name' => 'Gentoo'
Parsed ENV: 'SSH_AGENT_PID=3230' => 'SSH_AGENT_PID' => '3230'
Parsed ENV: 'TIMEFORMAT=' => 'TIMEFORMAT' => ''
Parsed ENV: 'real %3lR' => 'real %3lR' => ''
Parsed ENV: 'user %3lU' => 'user %3lU' => ''
Parsed ENV: 'sys %3lS' => 'sys %3lS' => ''
Parsed ENV: 'cpu %P%%' => 'cpu %P%%' => ''
Parsed ENV: '' => '' => ''
Parsed ENV: 'GSETTINGS_BACKEND=dconf' => 'GSETTINGS_BACKEND' => 'dconf'
And this really confuses tests.
--
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )