diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2001-07-12 15:50:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2001-07-12 15:50:40 +0000 |
commit | ba6ce41c4496f483b5c1c88f4c612fa41f9a2e9f (patch) | |
tree | a51fcf7a9aa1f3b1871c9ec9d4b7f52c4251b113 /lib/open.pm | |
parent | 70c4e4ee7b5c3958814603143a4843e0ec76b625 (diff) | |
download | perl-ba6ce41c4496f483b5c1c88f4c612fa41f9a2e9f.tar.gz |
fix for failing fork.t#12 on windows (win32_execvp() tweak in
change#11300 needs to return the status of failed win32_spawnvp())
fix various open.pm bugs: '\0' isn't the same as "\0", so it wasn't
splitting correctly; remove unused variables; 'require' at run time
rather than 'use' at compile time for I18N::Langinfo, since it
isn't everyware
p4raw-link: @11300 on //depot/perl: a52054cddb558e8fac6bc289e7eb6b2720470b9d
p4raw-id: //depot/perl@11310
Diffstat (limited to 'lib/open.pm')
-rw-r--r-- | lib/open.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/open.pm b/lib/open.pm index a42f62353b..441fc8cf60 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -10,9 +10,13 @@ sub in_locale { $^H & $locale::hint_bits } sub _get_locale_encoding { unless (defined $locale_encoding) { - eval { use I18N::Langinfo qw(langinfo CODESET) }; + eval { + # I18N::Langinfo isn't available everywhere + require I18N::Langinfo; + I18N::Langinfo->import('langinfo', 'CODESET'); + }; unless ($@) { - $locale_encoding = langinfo(CODESET); + $locale_encoding = langinfo(CODESET()); } my $country_language; if (not $locale_encoding && in_locale()) { @@ -49,9 +53,7 @@ sub import { my ($class,@args) = @_; croak("`use open' needs explicit list of disciplines") unless @args; $^H |= $open::hint_bits; - my ($in,$out) = split(/\0/,(${^OPEN} || '\0')); - my @in = split(/\s+/,$in); - my @out = split(/\s+/,$out); + my ($in,$out) = split(/\0/,(${^OPEN} || "\0"), -1); while (@args) { my $type = shift(@args); my $discp = shift(@args); |