From 63d8ee86e65a70f7c80143faec297c12d8c44979 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 12 Jul 2001 15:50:40 +0000 Subject: 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 --- lib/open.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/open.pm') 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); -- cgit v1.2.1