From: Abigail Date: Mon, 13 Jul 1998 03:04:24 +0000 (-0400) Subject: consistently refer to functions as C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab4f32c297ca404165732c897d45e499965c42dc;p=p5sagit%2Fp5-mst-13.2.git consistently refer to functions as C Message-ID: <19980713070424.19841.qmail@betelgeuse.wayne.fnx.com> Subject: Re: [PATCH 5.004_71] pod/perlfunc.pod p4raw-id: //depot/perl@1470 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 7eaf69a..9692dd4 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -90,12 +90,12 @@ than one place. =item Functions for SCALARs or strings C, C, C, C, C, C, C, C, -C, C, C, C, C/STRING/, C/STRING/, C, -C, C, C, C, C, C, C/// +C, C, C, C, C, C, C, +C, C, C, C, C, C, C =item Regular expressions and pattern matching -C//, C, C, C///, C, C, C +C, C, C, C, C, C, C =item Numeric functions @@ -108,7 +108,7 @@ C, C, C, C, C =item Functions for list data -C, C, C, C/STRING/, C, C, C +C, C, C, C, C, C, C =item Functions for real %HASHes @@ -149,7 +149,7 @@ C, C, C =item Functions for processes and process groups C, C, C, C, C, C, C, -C, C/STRING/, C, C, C, C, +C, C, C, C, C, C, C, C, C =item Keywords related to perl modules @@ -344,9 +344,9 @@ or else see L. It is usually a mistake to intermix C and C calls. If you want to use C to time out a system call you need to use an -C/C pair. You can't rely on the alarm causing the system call to +C/C pair. You can't rely on the alarm causing the system call to fail with C<$!> set to EINTR because Perl sets up signal handlers to -restart system calls on some systems. Using C/C always works, +restart system calls on some systems. Using C/C always works, modulo the caveats given in L. eval { @@ -387,10 +387,10 @@ not in binary mode have CR LF sequences translated to LF on input and LF translated to CR LF on output. Binmode has no effect under Unix; in MS-DOS and similarly archaic systems, it may be imperative--otherwise your MS-DOS-damaged C library may mangle your file. The key distinction between -systems that need C and those that don't is their text file +systems that need C and those that don't is their text file formats. Systems like Unix, MacOS, and Plan9 that delimit lines with a single character, and that encode that character in C as C<"\n">, do not need -C. The rest need it. If FILEHANDLE is an expression, the value +C. The rest need it. If FILEHANDLE is an expression, the value is taken as the name of the filehandle. =item bless REF,CLASSNAME @@ -424,7 +424,7 @@ to go back before the current one. $hasargs, $wantarray, $evaltext, $is_require) = caller($i); Here C<$subroutine> may be C<"(eval)"> if the frame is not a subroutine -call, but an C. In such a case additional elements C<$evaltext> and +call, but an C. In such a case additional elements C<$evaltext> and C<$is_require> are set: C<$is_require> is true if the frame is created by a C or C statement, C<$evaltext> contains the text of the C statement. In particular, for a C statement, @@ -437,7 +437,7 @@ detailed information: it sets the list variable C<@DB::args> to be the arguments with which the subroutine was invoked. Be aware that the optimizer might have optimized call frames away before -C had a chance to get the information. That means that C +C had a chance to get the information. That means that C might not return information about the call frame you expect it do, for C 1>. In particular, C<@DB::args> might have information from the previous time C was called. @@ -515,9 +515,9 @@ You can actually chop anything that's an lvalue, including an assignment: chop($answer = ); If you chop a list, each element is chopped. Only the value of the -last C is returned. +last C is returned. -Note that C returns the last character. To return all but the last +Note that C returns the last character. To return all but the last character, use C. =item chown LIST @@ -565,7 +565,7 @@ named directory the new root directory for all further pathnames that begin with a C<"/"> by your process and all its children. (It doesn't change your current working directory, which is unaffected.) For security reasons, this call is restricted to the superuser. If FILENAME is -omitted, does a C to C<$_>. +omitted, does a C to C<$_>. =item close FILEHANDLE @@ -578,10 +578,10 @@ is omitted. You don't have to close FILEHANDLE if you are immediately going to do another C on it, because C will close it for you. (See -C.) However, an explicit C on an input file resets the line +C.) However, an explicit C on an input file resets the line counter (C<$.>), while the implicit close done by C does not. -If the file handle came from a piped open C will additionally +If the file handle came from a piped open C will additionally return FALSE if one of the other system calls involved fails or if the program exits with non-zero status. (If the only problem was that the program exited non-zero C<$!> will be set to C<0>.) Also, closing a pipe @@ -702,7 +702,7 @@ Breaks the binding between a DBM file and a hash. [This function has been superseded by the C function.] This binds a dbm(3), ndbm(3), sdbm(3), gdbm(3), or Berkeley DB file to a -hash. HASH is the name of the hash. (Unlike normal C, the first +hash. HASH is the name of the hash. (Unlike normal C, the first argument is I a filehandle, even though it looks like one). DBNAME is the name of the database (without the F<.dir> or F<.pag> extension if any). If the database does not exist, it is created with protection @@ -1188,7 +1188,7 @@ When the arguments get executed via the system shell, results will be subject to its quirks and capabilities. See L for details. -Using an indirect object with C or C is also more secure. +Using an indirect object with C or C is also more secure. This usage forces interpretation of the arguments as a multivalued list, even if the list had just one argument. That way you're safe from the shell expanding wildcards or splitting up words with whitespace in them. @@ -1203,7 +1203,7 @@ program, passing it C<"surprise"> an argument. The second version didn't--it tried to run a program literally called I<"echo surprise">, didn't find it, and set C<$?> to a non-zero value indicating failure. -Note that C will not call your C blocks, nor will it call +Note that C will not call your C blocks, nor will it call any C methods in your objects. =item exists EXPR @@ -1271,8 +1271,8 @@ For example: fcntl($filehandle, F_GETFL, $packed_return_buffer) or die "can't fcntl F_GETFL: $!"; -You don't have to check for C on the return from -C. Like C, it maps a C<0> return from the system +You don't have to check for C on the return from +C. Like C, it maps a C<0> return from the system call into "C<0> but true" in Perl. This string is true in boolean context and C<0> in numeric context. It is also exempt from the normal B<-w> warnings on improper numeric @@ -1707,7 +1707,7 @@ also can't be used to go into a construct that is optimized away, or to get out of a block or subroutine given to C. It can be used to go almost anywhere else within the dynamic scope, including out of subroutines, but it's usually better to use some other -construct such as C or C. The author of Perl has never felt the +construct such as C or C. The author of Perl has never felt the need to use this form of C (in Perl, that is--C is another matter). The C form expects a label name, whose scope will be resolved @@ -1749,7 +1749,7 @@ supported, it can cause bizarre results if the LIST is not a named array. Similarly, grep returns aliases into the original list, much like the way that a for loops's index variable aliases the list elements. That is, modifying an element of a list returned by grep -(for example, in a C, C or another C) +(for example, in a C, C or another C) actually modifies the element in the original list. See also L for an array composed of the results of the BLOCK or EXPR. @@ -1804,7 +1804,7 @@ own, based on your C header files such as Fsys/ioctl.hE>. (There is a Perl script called B that comes with the Perl kit that may help you in this, but it's nontrivial.) SCALAR will be read and/or written depending on the FUNCTION--a pointer to the string value of SCALAR -will be passed as the third argument of the actual C call. (If SCALAR +will be passed as the third argument of the actual C call. (If SCALAR has no string value but does have a numeric value, that value will be passed rather than a pointer to the string value. To guarantee this to be TRUE, add a C<0> to the scalar before using it.) The C and C @@ -1823,7 +1823,7 @@ C. The following example sets the erase character to DEL. || die "Can't ioctl: $!"; } -The return value of C (and C) is as follows: +The return value of C (and C) is as follows: if OS returns: then Perl returns: -1 undefined value @@ -1872,14 +1872,14 @@ or how about sorted by key: print $key, '=', $ENV{$key}, "\n"; } -To sort an array by value, you'll need to use a C function. +To sort an array by value, you'll need to use a C function. Here's a descending numeric sort of a hash by its values: foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash) { printf "%4d %s\n", $hash{$key}, $key; } -As an lvalue C allows you to increase the number of hash buckets +As an lvalue C allows you to increase the number of hash buckets allocated for the given hash. This can gain you a measure of efficiency if you know the hash is going to get big. (This is similar to pre-extending an array by assigning a larger number to $#array.) If you say @@ -1891,7 +1891,7 @@ it rounds up to the next power of two. These buckets will be retained even if you do C<%hash = ()>, use C if you want to free the storage while C<%hash> is still in scope. You can't shrink the number of buckets allocated for the hash using -C in this way (but you needn't worry about doing this by accident, +C in this way (but you needn't worry about doing this by accident, as trying has no effect). =item kill LIST @@ -2074,7 +2074,7 @@ Calls the System V IPC function C. You'll probably have to say first to get the correct constant definitions. If CMD is C, then ARG must be a variable which will hold the returned C -structure. Returns like C: the undefined value for error, "C<0> but +structure. Returns like C: the undefined value for error, "C<0> but true" for zero, or the actual return value otherwise. See also C and C documentation. @@ -2103,8 +2103,8 @@ there is an error. See also C and C documentation. =item my EXPR -A C declares the listed variables to be local (lexically) to the -enclosing block, file, or C. If +A C declares the listed variables to be local (lexically) to the +enclosing block, file, or C. If more than one value is listed, the list must be placed in parentheses. See L for details. @@ -2155,8 +2155,8 @@ Opens the file whose filename is given by EXPR, and associates it with FILEHANDLE. If FILEHANDLE is an expression, its value is used as the name of the real filehandle wanted. If EXPR is omitted, the scalar variable of the same name as the FILEHANDLE contains the filename. -(Note that lexical variables--those declared with C--will not work -for this purpose; so if you're using C, specify EXPR in your call +(Note that lexical variables--those declared with C--will not work +for this purpose; so if you're using C, specify EXPR in your call to open.) If the filename begins with C<'E'> or nothing, the file is opened for input. @@ -2182,21 +2182,21 @@ that pipes both in I out, but see L, L, and L for alternatives.) Opening C<'-'> opens STDIN and opening C<'E-'> opens STDOUT. Open returns -nonzero upon success, the undefined value otherwise. If the C +nonzero upon success, the undefined value otherwise. If the C involved a pipe, the return value happens to be the pid of the subprocess. If you're unfortunate enough to be running Perl on a system that distinguishes between text files and binary files (modern operating systems don't care), then you should check out L for tips for -dealing with this. The key distinction between systems that need C +dealing with this. The key distinction between systems that need C and those that don't is their text file formats. Systems like Unix, MacOS, and Plan9, which delimit lines with a single character, and which encode that -character in C as C<"\n">, do not need C. The rest need it. +character in C as C<"\n">, do not need C. The rest need it. When opening a file, it's usually a bad idea to continue normal execution -if the request failed, so C is frequently used in connection with -C. Even if C won't do what you want (say, in a CGI script, +if the request failed, so C is frequently used in connection with +C. Even if C won't do what you want (say, in a CGI script, where you want to make a nicely formatted error message (but there are modules that can help with that problem)) you should always check the return value from opening a file. The infrequent exception is when @@ -2581,7 +2581,7 @@ you will have to use a block returning its value instead: Equivalent to C, except that C<$\> (the output record separator) is not appended. The first argument -of the list will be interpreted as the C format. If C is +of the list will be interpreted as the C format. If C is in effect, the character used for the decimal point in formatted real numbers is affected by the LC_NUMERIC locale. See L. @@ -2597,8 +2597,8 @@ the function whose prototype you want to retrieve. If FUNCTION is a string starting with C, the rest is taken as a name for Perl builtin. If builtin is not I (such as -C) or its arguments cannot be expressed by a prototype (such as -C) - in other words, the builtin does not behave like a Perl +C) or its arguments cannot be expressed by a prototype (such as +C) - in other words, the builtin does not behave like a Perl function - returns C. Otherwise, the string describing the equivalent prototype is returned. @@ -2947,7 +2947,7 @@ C<(some expression)> suffices. =item seek FILEHANDLE,POSITION,WHENCE -Sets FILEHANDLE's position, just like the C call of C. +Sets FILEHANDLE's position, just like the C call of C. FILEHANDLE may be an expression whose value gives the name of the filehandle. The values for WHENCE are C<0> to set the new position to POSITION, C<1> to set it to the current position plus POSITION, and C<2> to @@ -2996,7 +2996,7 @@ routine. Returns the currently selected filehandle. Sets the current default filehandle for output, if FILEHANDLE is supplied. This has two -effects: first, a C or a C without a filehandle will +effects: first, a C or a C without a filehandle will default to this FILEHANDLE. Second, references to variables related to output will refer to this output channel. For example, if you have to set the top of form format for more than one output channel, you might @@ -3068,13 +3068,13 @@ then only on POSIX systems. You have to use C instead. =item semctl ID,SEMNUM,CMD,ARG -Calls the System V IPC function C. You'll probably have to say +Calls the System V IPC function C. You'll probably have to say use IPC::SysV; first to get the correct constant definitions. If CMD is IPC_STAT or GETALL, then ARG must be a variable which will hold the returned -semid_ds structure or semaphore value array. Returns like C: the +semid_ds structure or semaphore value array. Returns like C: the undefined value for error, "C<0> but true" for zero, or the actual return value otherwise. See also C and C documentation. @@ -3238,7 +3238,7 @@ specified type. DOMAIN, TYPE, and PROTOCOL are specified the same as for the system call of the same name. If unimplemented, yields a fatal error. Returns TRUE if successful. -Some systems defined C in terms of C, in which a call +Some systems defined C in terms of C, in which a call to C is essentially: use Socket; @@ -3255,7 +3255,7 @@ See L for an example of socketpair use. =item sort LIST Sorts the LIST and returns the sorted list value. If SUBNAME or BLOCK -is omitted, Cs in standard string comparison order. If SUBNAME is +is omitted, Cs in standard string comparison order. If SUBNAME is specified, it gives the name of a subroutine that returns an integer less than, equal to, or greater than C<0>, depending on how the elements of the array are to be ordered. (The C=E> and C @@ -3472,11 +3472,11 @@ patterns that vary at runtime. (To do runtime compilation only once, use C.) As a special case, specifying a PATTERN of space (C<' '>) will split on -white space just as C with no arguments does. Thus, C can +white space just as C with no arguments does. Thus, C can be used to emulate B's default behavior, whereas C will give you as many null initial fields as there are leading spaces. -A C on C is like a C except that any leading -whitespace produces a null first field. A C with no arguments +A C on C is like a C except that any leading +whitespace produces a null first field. A C with no arguments really does a C internally. Example: @@ -3492,7 +3492,7 @@ L, and L.) =item sprintf FORMAT, LIST -Returns a string formatted by the usual C conventions of the +Returns a string formatted by the usual C conventions of the C library function C. See L or L on your system for an explanation of the general principles. @@ -3572,7 +3572,7 @@ root of C<$_>. =item srand -Sets the random number seed for the C operator. If EXPR is +Sets the random number seed for the C operator. If EXPR is omitted, uses a semi-random value based on the current time and process ID, among other things. In versions of Perl prior to 5.004 the default seed was just the current C. This isn't a particularly good seed, @@ -3581,7 +3581,7 @@ C