From a2008d6d9087873a23da5012f181cb674dbf4ab1 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 22 Jun 1998 01:14:14 +0000 Subject: [PATCH] merge relevant portions from maintbranch change#1155 p4raw-link: @1155 on //depot/maint-5.004/perl: c7664d5b6ade225b1576289e62712eec26808f84 p4raw-id: //depot/perl@1186 --- lib/Math/BigFloat.pm | 2 +- op.c | 2 +- pod/perlfunc.pod | 12 +++++++++++- pod/perlop.pod | 5 +++-- pod/perlrun.pod | 5 +++++ pp_hot.c | 8 ++++++-- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index 77fb5dd..576f341 100644 --- a/lib/Math/BigFloat.pm +++ b/lib/Math/BigFloat.pm @@ -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 --- 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) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 31367ed..bfb1c30 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -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 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. This is I what you want to use to capture the output from a command, for that you should use merely backticks or diff --git a/pod/perlop.pod b/pod/perlop.pod index c534234..0a081b5 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -774,9 +774,10 @@ If you change them, Perl won't even notice. If the PATTERN evaluates to the empty string, the last I matched regular expression is used instead. -If used in a context that requires a list value, a pattern match returns a +If the C option is not used, C 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. diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 72c772e..b0790d7 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -336,6 +336,11 @@ You can use C 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). +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 Directories specified by B<-I> are prepended to the search path for diff --git a/pp_hot.c b/pp_hot.c index 9fbd176..0133085 100644 --- 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)) -- 2.7.4