From: Perl 5 Porters Date: Sun, 17 Mar 1996 10:17:15 +0000 (+0000) Subject: Use $^O, and make more cautious about sending mail X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84478119e9ca91824749b0697737568f6913127f;p=p5sagit%2Fp5-mst-13.2.git Use $^O, and make more cautious about sending mail --- diff --git a/utils/perlbug.PL b/utils/perlbug.PL index a3aaefe..7a74c9f 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -15,8 +15,7 @@ use File::Basename qw(&basename &dirname); chdir(dirname($0)); ($file = basename($0)) =~ s/\.PL$//; $file =~ s/\.pl$// - if ($Config{'osname'} eq 'VMS' or - $Config{'osname'} eq 'OS2'); # "case-forgiving" + if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" open OUT,">$file" or die "Can't create $file: $!"; @@ -51,7 +50,7 @@ use strict; sub paraprint; -my($Version) = "1.12"; +my($Version) = "1.13"; # Changed in 1.06 to skip Mail::Send and Mail::Util if not available. # Changed in 1.07 to see more sendmail execs, and added pipe output. @@ -63,6 +62,8 @@ my($Version) = "1.12"; # Changed in 1.11 to clean up some text and removed Mail::Send deactivator. # Changed in 1.12 to check for editor errors, make save/send distinction # clearer and add $ENV{REPLYTO}. +# Changed in 1.13 to hopefully make it more difficult to accidentally +# send mail # TODO: Allow the user to re-name the file on mail failure, and # make sure failure (transmission-wise) of Mail::Send is @@ -76,6 +77,14 @@ Init(); if($::opt_h) { Help(); exit; } +if(!-t STDIN) { + paraprint <) { print $_ } close(REP); - } elsif( $action =~ /^s/i ) { # end + } elsif( $action =~ /^se/i ) { # end # Send the message - last; + print "\ +Are you certain you want to send this message? +Please type \"yes\" if you are: "; + my($reply) = scalar(); + chop($reply); + if( $reply eq "yes" ) { + last; + } } elsif( $action =~ /^[er]/i ) { # dit, e-edit # edit the message Edit(); @@ -486,6 +502,11 @@ EOF 1 while unlink($filename); # remove all versions under VMS print "\nCancelling.\n"; exit(0); + } elsif( $action =~ /^s/ ) { + paraprint <