diff options
author | Ilya Zakharevich <ilya@math.ohio-state.edu> | 1997-06-06 15:35:40 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +1200 |
commit | 4935d2c2574073146066c5d9b654a47d71a2cc2a (patch) | |
tree | f4cd3167d0fbc38e45e79d1b1fb51c8821965fe6 /utils/perlbug.PL | |
parent | 793c8a6a9f5f03894b64e7fffc2268ea8af67c2f (diff) | |
download | perl-4935d2c2574073146066c5d9b654a47d71a2cc2a.tar.gz |
perlbug under OS/2
We actually check for return from sendmail (!), protect agains getpw*
missing in Perl, and do some harder work under OS/2.
Enjoy,
p5p-msgid: 199707180333.XAA03102@monk.mps.ohio-state.edu
Diffstat (limited to 'utils/perlbug.PL')
-rw-r--r-- | utils/perlbug.PL | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 9161488c2d..2b11012fae 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -181,7 +181,11 @@ sub Init { )); # My username - $me = ($Is_MSWin32 ? $ENV{'USERNAME'} : getpwuid($<)); + $me = ( $Is_MSWin32 + ? $ENV{'USERNAME'} + : ( $^O eq 'os2' + ? $ENV{'USER'} || $ENV{'LOGNAME'} + : eval { getpwuid($<) }) ); # May be missing } @@ -718,6 +722,7 @@ sub Send { $fh->close; + print "\nMessage sent.\n"; } else { if ($Is_VMS) { if ( ($address =~ /@/ and $address !~ /^\w+%"/) or @@ -739,6 +744,18 @@ sub Send { { $sendmail = $_, last if -e $_; } + + if ($^O eq 'os2' and $sendmail eq "") { + my $path = $ENV{PATH}; + $path =~ s:\\:/: ; + my @path = split /$Config{path_sep}/, $path; + for (@path) { + $sendmail = "$_/sendmail", last + if -e "$_/sendmail"; + $sendmail = "$_/sendmail.exe", last + if -e "$_/sendmail.exe"; + } + } paraprint <<"EOF", die "\n" if $sendmail eq ""; @@ -761,12 +778,14 @@ EOF while(<REP>) { print SENDMAIL $_ } close(REP); - close(SENDMAIL); + if (close(SENDMAIL)) { + print "\nMessage sent.\n"; + } else { + warn "\nSendmail returned status '",$?>>8,"'\n"; + } } } - - print "\nMessage sent.\n"; 1 while unlink($filename); # remove all versions under VMS |