merge relevant portions from maintbranch change#1155
authorGurusamy Sarathy <gsar@cpan.org>
Mon, 22 Jun 1998 01:14:14 +0000 (01:14 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Mon, 22 Jun 1998 01:14:14 +0000 (01:14 +0000)
p4raw-link: @1155 on //depot/maint-5.004/perl: c7664d5b6ade225b1576289e62712eec26808f84

p4raw-id: //depot/perl@1186

lib/Math/BigFloat.pm
op.c
pod/perlfunc.pod
pod/perlop.pod
pod/perlrun.pod
pp_hot.c

index 77fb5dd..576f341 100644 (file)
@@ -274,7 +274,7 @@ Math::BigFloat - Arbitrary length float math package
 
 =head1 SYNOPSIS
 
-  use Math::BogFloat;
+  use Math::BigFloat;
   $f = Math::BigFloat->new($string);
 
   $f->fadd(NSTR) return NSTR            addition
diff --git a/op.c b/op.c
index 472a475..d390205 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3383,7 +3383,7 @@ newSUB(I32 floor, OP *o, OP *proto, OP *block)
     GV *gv = gv_fetchpv(name ? name : "__ANON__",
                        GV_ADDMULTI | (block ? 0 : GV_NOINIT), SVt_PVCV);
     char *ps = proto ? SvPVx(((SVOP*)proto)->op_sv, na) : Nullch;
-    register CV *cv;
+    register CV *cv=0;
     I32 ix;
 
     if (o)
index 31367ed..bfb1c30 100644 (file)
@@ -3836,7 +3836,17 @@ the new position.
 Does exactly the same thing as "exec LIST" except that a fork is done
 first, and the parent process waits for the child process to complete.
 Note that argument processing varies depending on the number of
-arguments.  The return value is the exit status of the program as
+arguments.  If there is more than one argument in LIST, or if LIST is
+an array with more than one value, starts the program given by the
+first element of the list with arguments given by the rest of the list.
+If there is only one scalar argument, the argument is
+checked for shell metacharacters, and if there are any, the entire
+argument is passed to the system's command shell for parsing (this is
+C</bin/sh -c> on Unix platforms, but varies on other platforms).  If
+there are no shell metacharacters in the argument, it is split into
+words and passed directly to execvp(), which is more efficient.
+
+The return value is the exit status of the program as
 returned by the wait() call.  To get the actual exit value divide by
 256.  See also L</exec>.  This is I<NOT> what you want to use to capture
 the output from a command, for that you should use merely backticks or
index c534234..0a081b5 100644 (file)
@@ -774,9 +774,10 @@ If you change them, Perl won't even notice.
 If the PATTERN evaluates to the empty string, the last
 I<successfully> matched regular expression is used instead.
 
-If used in a context that requires a list value, a pattern match returns a
+If the C</g> option is not used, C<m//> in a list context returns a
 list consisting of the subexpressions matched by the parentheses in the
-pattern, i.e., (C<$1>, $2, $3...).  (Note that here $1 etc. are also set, and
+pattern, i.e., (C<$1>, C<$2>, C<$3>...).  (Note that here
+C<$1> etc. are also set, and
 that this differs from Perl 4's behavior.)  If there are no parentheses,
 the return value is the list C<(1)> for success or C<('')> upon failure.
 With parentheses, C<()> is returned upon failure.
index 72c772e..b0790d7 100644 (file)
@@ -336,6 +336,11 @@ You can use C<eof> without parentheses to locate the end of each input file,
 in case you want to append to each file, or reset line numbering (see
 example in L<perlfunc/eof>).
 
+Finally, note that the B<-i> switch does not impede execution when no
+files are given on the command line.  In this case, no backup is made
+(the original file cannot, of course, be determined) and processing
+proceeds from STDIN to STDOUT as might be expected.
+
 =item B<-I>I<directory>
 
 Directories specified by B<-I> are prepended to the search path for
index 9fbd176..0133085 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1027,8 +1027,11 @@ do_readline(void)
                    IoFLAGS(io) &= ~IOf_START;
                    IoLINES(io) = 0;
                    if (av_len(GvAVn(last_in_gv)) < 0) {
-                       SV *tmpstr = newSVpv("-", 1); /* assume stdin */
-                       av_push(GvAVn(last_in_gv), tmpstr);
+                       do_open(last_in_gv,"-",1,FALSE,0,0,Nullfp);
+                       sv_setpvn(GvSV(last_in_gv), "-", 1);
+                       SvSETMAGIC(GvSV(last_in_gv));
+                       fp = IoIFP(io);
+                       goto have_fp;
                    }
                }
                fp = nextargv(last_in_gv);
@@ -1176,6 +1179,7 @@ do_readline(void)
        }
        RETURN;
     }
+  have_fp:
     if (gimme == G_SCALAR) {
        sv = TARG;
        if (SvROK(sv))