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()) {
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);
/* if this is a pseudo-forked child, we just want to spawn
* the new program, and return */
if (w32_pseudo_id) {
- my_exit(win32_spawnvp(P_WAIT, cmdname, (char *const *)argv));
- return 0;
+ int status = win32_spawnvp(P_WAIT, cmdname, (char *const *)argv);
+ if (status != -1) {
+ my_exit(status);
+ return 0;
+ }
+ else
+ return status;
}
#endif
return execvp(cmdname, (char *const *)argv);