From c17cdb7237c28869f5b1e32776642668fb49707c Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 29 Jan 2012 14:56:01 +0000 Subject: Add annotations to perlfunc.pod for Pod::Functions. In the list for "Perl Functions by Category" each item is annotated with its type as used internally by Pod::Functions. In the "Alphabetical Listing of Perl Functions" each function is annotated with the summary description returned by %Pod::Functions::Flavor. --- pod/perlfunc.pod | 498 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 498 insertions(+) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 7e93eae851..c4aa935ea1 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -107,6 +107,8 @@ than one place. =item Functions for SCALARs or strings X X X +=for Pod::Functions =String + C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C @@ -119,32 +121,44 @@ with a C (or higher) declaration in the current scope. =item Regular expressions and pattern matching X X X +=for Pod::Functions =Regexp + C, C, C, C, C, C, C =item Numeric functions X X X X +=for Pod::Functions =Math + C, C, C, C, C, C, C, C, C, C, C, C =item Functions for real @ARRAYs X +=for Pod::Functions =ARRAY + C, C, C, C, C, C, C, C =item Functions for list data X +=for Pod::Functions =LIST + C, C, C, C, C, C, C =item Functions for real %HASHes X +=for Pod::Functions =HASH + C, C, C, C, C =item Input and output functions X X X X +=for Pod::Functions =I/O + C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C C, C, C, C, C X =item select +=for Pod::Functions reset default output or do I/O multiplexing + Returns the currently selected filehandle. If FILEHANDLE is supplied, sets the new current default filehandle for output. This has two effects: first, a C or a C without a filehandle @@ -5799,6 +6171,8 @@ Portability issues: L. =item semctl ID,SEMNUM,CMD,ARG X +=for Pod::Functions SysV semaphore control operations + Calls the System V IPC function semctl(2). You'll probably have to say use IPC::SysV; @@ -5817,6 +6191,8 @@ Portability issues: L. =item semget KEY,NSEMS,FLAGS X +=for Pod::Functions get set of SysV semaphores + Calls the System V IPC function semget(2). Returns the semaphore id, or the undefined value on error. See also L, C, C @@ -5827,6 +6203,8 @@ Portability issues: L. =item semop KEY,OPSTRING X +=for Pod::Functions SysV semaphore operations + Calls the System V IPC function semop(2) for semaphore operations such as signalling and waiting. OPSTRING must be a packed array of semop structures. Each semop structure can be generated with @@ -5849,6 +6227,8 @@ X =item send SOCKET,MSG,FLAGS +=for Pod::Functions send a message over a socket + Sends a message on a socket. Attempts to send the scalar MSG to the SOCKET filehandle. Takes the same flags as the system call of the same name. On unconnected sockets, you must specify a destination to I, in which @@ -5867,6 +6247,8 @@ pragma: in that case pretty much any characters can be sent. =item setpgrp PID,PGRP X X +=for Pod::Functions set the process group of a process + Sets the current process group for the specified PID, C<0> for the current process. Raises an exception when used on a machine that doesn't implement POSIX setpgid(2) or BSD setpgrp(2). If the arguments are omitted, @@ -5879,6 +6261,8 @@ Portability issues: L. =item setpriority WHICH,WHO,PRIORITY X X X X +=for Pod::Functions set a process's nice value + Sets the current priority for a process, a process group, or a user. (See setpriority(2).) Raises an exception when used on a machine that doesn't implement setpriority(2). @@ -5888,6 +6272,8 @@ Portability issues: L. =item setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL X +=for Pod::Functions set some socket options + Sets the socket option requested. Returns C on error. Use integer constants provided by the C module for LEVEL and OPNAME. Values for LEVEL can also be obtained from @@ -5908,6 +6294,8 @@ X =item shift +=for Pod::Functions remove the first element of an array, and return it + Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down. If there are no elements in the array, returns the undefined value. If ARRAY is omitted, shifts the @@ -5935,6 +6323,8 @@ right end. =item shmctl ID,CMD,ARG X +=for Pod::Functions SysV shared memory operations + Calls the System V IPC function shmctl. You'll probably have to say use IPC::SysV; @@ -5950,6 +6340,8 @@ Portability issues: L. =item shmget KEY,SIZE,FLAGS X +=for Pod::Functions get SysV shared memory segment identifier + Calls the System V IPC function shmget. Returns the shared memory segment id, or C on error. See also L and C documentation. @@ -5960,8 +6352,12 @@ Portability issues: L. X X +=for Pod::Functions read SysV shared memory + =item shmwrite ID,STRING,POS,SIZE +=for Pod::Functions write SysV shared memory + Reads or writes the System V shared memory segment ID starting at position POS for size SIZE by attaching to it, copying in/out, and detaching from it. When reading, VAR must be a variable that will @@ -5976,6 +6372,8 @@ Portability issues: L and L. =item shutdown SOCKET,HOW X +=for Pod::Functions close down just half of a socket connection + Shuts down a socket connection in the manner indicated by HOW, which has the same interpretation as in the syscall of the same name. @@ -5998,6 +6396,8 @@ X X X X =item sin +=for Pod::Functions return the sine of a number + Returns the sine of EXPR (expressed in radians). If EXPR is omitted, returns sine of C<$_>. @@ -6011,6 +6411,8 @@ X X =item sleep +=for Pod::Functions block for some number of seconds + Causes the script to sleep for (integer) EXPR seconds, or forever if no argument is given. Returns the integer number of seconds actually slept. @@ -6043,6 +6445,8 @@ See also the POSIX module's C function. =item socket SOCKET,DOMAIN,TYPE,PROTOCOL X +=for Pod::Functions create a socket + Opens a socket of the specified kind and attaches it to filehandle SOCKET. DOMAIN, TYPE, and PROTOCOL are specified the same as for the syscall of the same name. You should C first @@ -6056,6 +6460,8 @@ value of $^F. See L. =item socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL X +=for Pod::Functions create a pair of sockets + Creates an unnamed pair of sockets in the specified domain, of the specified type. DOMAIN, TYPE, and PROTOCOL are specified the same as for the syscall of the same name. If unimplemented, raises an exception. @@ -6086,6 +6492,8 @@ X X X X =item sort LIST +=for Pod::Functions sort a list of values + In list context, this sorts the LIST and returns the sorted list value. In scalar context, the behaviour of C is undefined. @@ -6279,6 +6687,8 @@ X =item splice ARRAY or EXPR +=for Pod::Functions add or remove elements anywhere in an array + Removes the elements designated by OFFSET and LENGTH from an array, and replaces them with the elements of LIST, if any. In list context, returns the elements removed from the array. In scalar context, @@ -6334,6 +6744,8 @@ X =item split +=for Pod::Functions split up a string using a regexp delimiter + Splits the string EXPR into a list of strings and returns the list in list context, or the size of the list in scalar context. @@ -6483,6 +6895,8 @@ comment): =item sprintf FORMAT, LIST X +=for Pod::Functions formatted print into a string + Returns a string formatted by the usual C conventions of the C library function C. See below for more details and see L or L on your system for an explanation of @@ -6825,6 +7239,8 @@ X X X =item sqrt +=for Pod::Functions square root function + Return the positive square root of EXPR. If EXPR is omitted, uses C<$_>. Works only for non-negative operands unless you've loaded the C module. @@ -6837,6 +7253,8 @@ X X X =item srand +=for Pod::Functions seed the random number generator + Sets and returns the random number seed for the C operator. The point of the function is to "seed" the C function so that C @@ -6907,6 +7325,8 @@ X X X =item stat +=for Pod::Functions get a file's status information + Returns a 13-element list giving the status info for a file, either the file opened via FILEHANDLE or DIRHANDLE, or named by EXPR. If EXPR is omitted, it stats C<$_> (not C<_>!). Returns the empty list if C fails. Typically @@ -7045,6 +7465,8 @@ X =item state TYPE EXPR : ATTRS +=for Pod::Functions declare and assign a persistent lexical variable + C declares a lexically scoped variable, just like C. However, those variables will never be reinitialized, contrary to lexical variables that are reinitialized each time their enclosing block @@ -7060,6 +7482,8 @@ X =item study +=for Pod::Functions optimize input data for repeated searches + Takes extra time to study SCALAR (C<$_> if unspecified) in anticipation of doing many pattern matches on the string before it is next modified. This may or may not save time, depending on the nature and number of @@ -7123,6 +7547,8 @@ X =item sub NAME (PROTO) : ATTRS BLOCK +=for Pod::Functions declare a subroutine, possibly anonymously + This is subroutine definition, not a real function I. Without a BLOCK it's just a forward declaration. Without a NAME, it's an anonymous function declaration, so does return a value: the CODE ref of the closure @@ -7135,6 +7561,8 @@ information about attributes. =item __SUB__ X<__SUB__> +=for Pod::Functions the current subroutine, or C if not in a subroutine + A special token that returns the a reference to the current subroutine, or C outside of a subroutine. @@ -7148,6 +7576,8 @@ X X X X X =item substr EXPR,OFFSET +=for Pod::Functions get or alter a portion of a string + Extracts a substring out of EXPR and returns it. First character is at offset zero. If OFFSET is negative, starts that far back from the end of the string. If LENGTH is omitted, returns @@ -7218,6 +7648,8 @@ unspecified. =item symlink OLDFILE,NEWFILE X X X X +=for Pod::Functions create a symbolic link to a file + Creates a new filename symbolically linked to the old filename. Returns C<1> for success, C<0> otherwise. On systems that don't support symbolic links, raises an exception. To check for that, @@ -7230,6 +7662,8 @@ Portability issues: L. =item syscall NUMBER, LIST X X +=for Pod::Functions execute an arbitrary system call + Calls the system call specified as the first element of the list, passing the remaining elements as arguments to the system call. If unimplemented, raises an exception. The arguments are interpreted @@ -7269,6 +7703,8 @@ X =item sysopen FILEHANDLE,FILENAME,MODE,PERMS +=for Pod::Functions open a file, pipe, or descriptor + Opens the file whose filename is given by FILENAME, and associates it with FILEHANDLE. If FILEHANDLE is an expression, its value is used as the real filehandle wanted; an undefined scalar will be suitably autovivified. This @@ -7334,6 +7770,8 @@ X =item sysread FILEHANDLE,SCALAR,LENGTH +=for Pod::Functions fixed-length unbuffered input from a filehandle + Attempts to read LENGTH bytes of data into variable SCALAR from the specified FILEHANDLE, using the read(2). It bypasses buffered IO, so mixing this with other kinds of reads, C, @@ -7364,6 +7802,8 @@ See L, L, and the C pragma, L. =item sysseek FILEHANDLE,POSITION,WHENCE X X +=for Pod::Functions position I/O pointer on handle used with sysread and syswrite + Sets FILEHANDLE's system position in bytes using lseek(2). 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 the it @@ -7397,6 +7837,8 @@ X X =item system PROGRAM LIST +=for Pod::Functions run a separate program + Does exactly the same thing as C, except that a fork is done first and the parent process waits for the child process to exit. Note that argument processing varies depending on the @@ -7473,6 +7915,8 @@ X =item syswrite FILEHANDLE,SCALAR +=for Pod::Functions fixed-length unbuffered output to a filehandle + Attempts to write LENGTH bytes of data from variable SCALAR to the specified FILEHANDLE, using write(2). If LENGTH is not specified, writes whole SCALAR. It bypasses buffered IO, so @@ -7502,6 +7946,8 @@ X =item tell +=for Pod::Functions get current seekpointer on a filehandle + Returns the current position I for FILEHANDLE, or -1 on error. FILEHANDLE may be an expression whose value gives the name of the actual filehandle. If FILEHANDLE is omitted, assumes the file @@ -7525,6 +7971,8 @@ Those functions ignore the buffering, while tell() does not. =item telldir DIRHANDLE X +=for Pod::Functions get current seekpointer on a directory handle + Returns the current position of the C routines on DIRHANDLE. Value may be given to C to access a particular location in a directory. C has the same caveats about possible directory @@ -7533,6 +7981,8 @@ compaction as the corresponding system library routine. =item tie VARIABLE,CLASSNAME,LIST X +=for Pod::Functions bind a variable to an object class + This function binds a variable to a package class that will provide the implementation for the variable. VARIABLE is the name of the variable to be enchanted. CLASSNAME is the name of a class implementing objects @@ -7625,6 +8075,8 @@ For further details see L, L<"tied VARIABLE">. =item tied VARIABLE X +=for Pod::Functions get a reference to the object underlying a tied variable + Returns a reference to the object underlying VARIABLE (the same value that was originally returned by the C call that bound the variable to a package.) Returns the undefined value if VARIABLE isn't tied to a @@ -7633,6 +8085,8 @@ package. =item time X