In perl.git, the branch smoke-me/Pod-Functions has been updated <http://perl5.git.perl.org/perl.git/commitdiff/50f6def25a92b0691802c8db7e80976cf49a44e2?hp=5e909f4bb1064c090091941ad075a132e8f63121>
- Log ----------------------------------------------------------------- commit 50f6def25a92b0691802c8db7e80976cf49a44e2 Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 23:38:43 2012 +0100 Teach Pod::Functions that each, keys and values also operate on arrays. These were added to the section 'Functions for real @ARRAYs' in perlfunc.pod by commit a5ce339cb0c533c9 in Sep 2010. As ever, tweak the golden results in the test to match these changes. M lib/Pod/Functions.pm M lib/Pod/t/Functions.t commit 0e039f6721cf656e1dd1f1ddeacbe7253bb93c92 Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 23:16:56 2012 +0100 Add all missing functions to Pod::Functions. evalbytes was added to perlfunc.pod by commit 7289c5e6ca773d7c in Nov 2011. say was added by commit 0d863452f5cac863 in Dec 2005. state was added.pod by commit 36fb85f3330d45ee in Jul 2006. __FILE__, __LINE__ and __PACKAGE__ were added by commit cfa52385fa426b5e in Aug 2011, and __SUB__ by commit 84ed01088568ffe9 in Nov 2011. Again, tweak the golden results in the test to match these changes. M lib/Pod/Functions.pm M lib/Pod/t/Functions.t commit ef4b736b6e4d692feac83f67cb77143a89673548 Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 22:44:52 2012 +0100 Teach Pod::Functions about 'Keywords related to the switch feature'. Commit 0d863452f5cac863 in Dec 2005 added the switch feature, along with documentation in perlfunc.pod, but did not update Pod::Functions. Again, tweak the golden results in the test to match these changes. M lib/Pod/Functions.pm M lib/Pod/t/Functions.t commit a9f5c8f93e28a371a03dafdc0d6db2e30be4ead2 Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 21:47:16 2012 +0100 Update Pod::Functions with changes from perlfunc.pod Updated description of Binary from commit 5dac7880bdc47787 in Feb 2011. Updated description of Flow from commit cf2649810f00335b in Jul 2005, and added the "the" which has always been missing from Pod::Function's version. Updated description of Modules from commit 3b10bc60979cfe9a in Jan 2010. Updated description of Objects from commit 353c650532037e40 in Oct 2007. The description of Namespaces had always differed from that in perlfunc.pod. Remove stray tabs from the descriptions of gets and sprintf. Commit 19799a22062ef658 (May 1999) added lock to perlfunc.pod without a it is the only function in "Threads", move it to "Misc", instead of creating a category just for it. use always had two entries with different descriptions in the __DATA__ section. This isn't actually sensible, as the code that builds the exported data structures ends up taking Types from both, and using the last description that it sees. So merge the two together to reflect this. Drop the CHANGES section from the Pod, which is both incomplete and redundant, given that version control does this job much better. Tweak the golden results in the test to match these changes. M lib/Pod/Functions.pm M lib/Pod/t/Functions.t commit 39b094a484f2f2d465e12f363049527e7c448d7f Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 17:51:48 2012 +0100 In perlfunc.pod, sort the descriptions more consistently. The order is neither strictly lexical, nor strictly dictionary, but now for all cases __FOO__ follows foo, and qx// is after qw//. M pod/perlfunc.pod commit ae9d5c6d1f6b536fa8180066ba0832fd1d194654 Author: Nicholas Clark <[email protected]> Date: Mon Jan 23 17:32:17 2012 +0100 Add 4 functions missing from perlfunc.pod's 'Perl Functions by Category'. C<readline> added to 'Input and output functions' Documentation on readline was added by commit 8490252049bf42d3 in Aug 1997. That commit also added readpipe without adding it to a category group, an omission that was fixed by commit 4319b00c03e6a517 in Nov 2011. C<sysseek> added to 'Functions for fixed-length data or records' Documentation on sysseek was added by commit 137443ea0a858c43 in Apr 1997, which implemented sysseek. C<prototype> added to both 'Keywords related to the control flow of your Perl program' and 'Miscellaneous functions', as Pod::Functions places it in both. Commit da0045b73af6f504 in Jul 1996, included 'Add documentation for new "prototype" operator', but only added the main documentation, not an entry in a category group. C<lock> added to 'Miscellaneous functions'. Documentation on lock was added by commit 19799a22062ef658 in May 1999. M pod/perlfunc.pod ----------------------------------------------------------------------- Summary of changes: lib/Pod/Functions.pm | 55 ++++++++++++++++++++++++------------------------- lib/Pod/t/Functions.t | 34 +++++++++++++++++------------- pod/perlfunc.pod | 27 ++++++++++++----------- 3 files changed, 60 insertions(+), 56 deletions(-) diff --git a/lib/Pod/Functions.pm b/lib/Pod/Functions.pm index 5181c39..f06bd43 100644 --- a/lib/Pod/Functions.pm +++ b/lib/Pod/Functions.pm @@ -52,22 +52,9 @@ L<perlfunc/"Perl Functions by Category"> section. =back -=head1 CHANGES - -1.02 20020813 <[email protected]> - de-typo in the SYNOPSIS section (thanks Mike Castle for noticing) - -1.01 20011229 <[email protected]> - fixed some bugs that slipped in after 5.6.1 - added the pod - finished making it strict safe - -1.00 ?? - first numbered version - =cut -our $VERSION = '1.04'; +our $VERSION = '1.05'; require Exporter; @@ -78,25 +65,26 @@ our(%Kinds, %Type, %Flavor); our %Type_Description = ( 'ARRAY' => 'Functions for real @ARRAYs', - 'Binary' => 'Functions for fixed length data or records', + 'Binary' => 'Functions for fixed-length data or records', 'File' => 'Functions for filehandles, files, or directories', - 'Flow' => 'Keywords related to control flow of your perl program', + 'Flow' => 'Keywords related to the control flow of your Perl program', 'HASH' => 'Functions for real %HASHes', 'I/O' => 'Input and output functions', 'LIST' => 'Functions for list data', 'Math' => 'Numeric functions', 'Misc' => 'Miscellaneous functions', - 'Modules' => 'Keywords related to perl modules', + 'Modules' => 'Keywords related to Perl modules', 'Network' => 'Fetching network info', - 'Objects' => 'Keywords related to classes and object-orientedness', + 'Objects' => 'Keywords related to classes and object-orientation', 'Process' => 'Functions for processes and process groups', 'Regexp' => 'Regular expressions and pattern matching', 'Socket' => 'Low-level socket functions', 'String' => 'Functions for SCALARs or strings', + 'Switch' => 'Keywords related to the switch feature', 'SysV' => 'System V interprocess communication functions', 'Time' => 'Time-related functions', 'User' => 'Fetching user and group info', - 'Namespace' => 'Keywords altering or affecting scoping of identifiers', + 'Namespace' => 'Keywords related to scoping', ); our @Type_Order = qw{ @@ -110,6 +98,7 @@ our @Type_Order = qw{ Binary File Flow + Switch Namespace Misc Process @@ -177,7 +166,7 @@ chroot File make directory new root for path lookups close I/O close file (or pipe or socket) handle closedir I/O close directory handle connect Socket connect to a remote socket -continue Flow optional trailing block in a while or foreach +continue Flow,Switch optional trailing block in a while or foreach cos Math cosine function crypt String one-way passwd-style encryption dbmclose Objects,I/O breaks binding on a tied dbm file @@ -187,7 +176,7 @@ delete HASH deletes a value from a hash die I/O,Flow raise an exception or bail out do Flow,Modules turn a BLOCK into a TERM dump Misc,Flow create an immediate core dump -each HASH retrieve the next key/value pair from a hash +each ARRAY,HASH retrieve the next key/value pair from a hash endgrent User be done using group file endhostent User be done using hosts file endnetent User be done using networks file @@ -206,7 +195,7 @@ flock I/O lock an entire file with an advisory lock fork Process create a new process just like this one format I/O declare a picture format with use by the write() function formline Misc internal function used for formats -getc I/O get the next character from the filehandle +getc I/O get the next character from the filehandle getgrent User get next group record getgrgid User get group record given group user ID getgrnam User get group record given group name @@ -242,7 +231,7 @@ index String find a substring within a string int Math get the integer portion of a number ioctl File system-dependent device control system call join LIST join a list into a string using a separator -keys HASH retrieve list of indices from a hash +keys ARRAY,HASH retrieve list of indices from a hash kill Process send a signal to a process or process group last Flow exit a block prematurely lc String return lower-case version of a string @@ -252,7 +241,7 @@ link File create a hard link in the filesystem listen Socket register your socket as a server local Misc,Namespace create a temporary value for a global variable (dynamic scoping) localtime Time convert UNIX time into record or string using local time -lock Threads get a thread lock on a variable, subroutine, or method +lock Misc get a thread lock on a variable, subroutine, or method log Math retrieve the natural logarithm for a number lstat File stat a symbolic link m// Regexp match a string with a regular expression pattern @@ -333,7 +322,7 @@ socketpair Socket create a pair of sockets sort LIST sort a list of values splice ARRAY add or remove elements anywhere in an array split Regexp split up a string using a regexp delimiter -sprintf String formatted print into a string +sprintf String formatted print into a string sqrt Math square root function srand Math seed the random number generator stat File get a file's status information @@ -363,10 +352,9 @@ unlink File remove one link to a file unpack Binary,LIST convert binary structure into normal perl variables unshift ARRAY prepend more elements to the beginning of a list untie Objects break a tie binding to a variable -use Modules,Namespace load a module and import its namespace -use Objects load in a module at compile time +use Objects,Modules,Namespace load in a module at compile time and import its namespace utime File set a file's last access and modify times -values HASH return a list of the values in a hash +values ARRAY,HASH return a list of the values in a hash vec Binary test or set particular bits in a string wait Process wait for any child process to die waitpid Process wait for a particular child process to die @@ -374,3 +362,14 @@ wantarray Misc,Flow get void vs scalar vs list context of current subroutine cal warn I/O print debugging info write I/O print a picture record y/// String transliterate a string +break Switch Break out of a C<given()> block +default Switch XXX RT #108848 +given Switch XXX RT #108848 +when Switch XXX RT #108848 +evalbytes Flow,Misc similar to string eval, but intend to parse a bytestream +say I/O output a list to a filehandle, appending a newline +state Misc,Namespace declare and assign a persistent lexical variable +__FILE__ Flow the name of the current source file +__LINE__ Flow the current source line number +__PACKAGE__ Flow the current package +__SUB__ Flow the current subroutine, or C<undef> if not in a subroutine diff --git a/lib/Pod/t/Functions.t b/lib/Pod/t/Functions.t index 8f44d81..fb1f1f3 100644 --- a/lib/Pod/t/Functions.t +++ b/lib/Pod/t/Functions.t @@ -33,9 +33,9 @@ is( $pkg_ref, $exp_ref, '@Pod::Functions::Type_Order exported' ); # Check @Type_Order my @catagories = qw( - String Regexp Math ARRAY LIST HASH I/O - Binary File Flow Namespace Misc Process Modules - Objects Socket SysV User Network Time + String Regexp Math ARRAY LIST HASH I/O + Binary File Flow Switch Namespace Misc Process + Modules Objects Socket SysV User Network Time ); ok( eq_array( \@Type_Order, \@catagories ), @@ -87,7 +87,7 @@ Numeric functions: srand Functions for real @ARRAYs: - pop, push, shift, splice, unshift + each, keys, pop, push, shift, splice, unshift, values Functions for list data: grep, join, map, qw/STRING/, reverse, sort, unpack @@ -98,11 +98,11 @@ Functions for real %HASHes: Input and output functions: binmode, close, closedir, dbmclose, dbmopen, die, eof, fileno, flock, format, getc, print, printf, read, readdir, - readline, rewinddir, seek, seekdir, select, syscall, + readline, rewinddir, say, seek, seekdir, select, syscall, sysread, sysseek, syswrite, tell, telldir, truncate, warn, write -Functions for fixed length data or records: +Functions for fixed-length data or records: pack, read, syscall, sysread, sysseek, syswrite, unpack, vec @@ -111,26 +111,30 @@ Functions for filehandles, files, or directories: lstat, mkdir, open, opendir, readlink, rename, rmdir, stat, symlink, sysopen, umask, unlink, utime -Keywords related to control flow of your perl program: - caller, continue, die, do, dump, eval, exit, goto, last, - next, prototype, redo, return, sub, wantarray +Keywords related to the control flow of your Perl program: + __FILE__, __LINE__, __PACKAGE__, __SUB__, caller, + continue, die, do, dump, eval, evalbytes, exit, goto, + last, next, prototype, redo, return, sub, wantarray -Keywords altering or affecting scoping of identifiers: - caller, import, local, my, our, package, use +Keywords related to the switch feature: + break, continue, default, given, when + +Keywords related to scoping: + caller, import, local, my, our, package, state, use Miscellaneous functions: - defined, dump, eval, formline, local, my, our, prototype, - reset, scalar, undef, wantarray + defined, dump, eval, evalbytes, formline, local, lock, my, + our, prototype, reset, scalar, state, undef, wantarray Functions for processes and process groups: alarm, exec, fork, getpgrp, getppid, getpriority, kill, pipe, qx/STRING/, readpipe, setpgrp, setpriority, sleep, system, times, wait, waitpid -Keywords related to perl modules: +Keywords related to Perl modules: do, import, no, package, require, use -Keywords related to classes and object-orientedness: +Keywords related to classes and object-orientation: bless, dbmclose, dbmopen, package, ref, tie, tied, untie, use diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index a39ccfd..5b4eb40 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -142,13 +142,14 @@ X<I/O> X<input> X<output> X<dbm> C<binmode>, C<close>, C<closedir>, C<dbmclose>, C<dbmopen>, C<die>, C<eof>, C<fileno>, C<flock>, C<format>, C<getc>, C<print>, C<printf>, C<read>, -C<readdir>, C<rewinddir>, C<say>, C<seek>, C<seekdir>, C<select>, C<syscall>, -C<sysread>, C<sysseek>, C<syswrite>, C<tell>, C<telldir>, C<truncate>, -C<warn>, C<write> +C<readdir>, C<readline> C<rewinddir>, C<say>, C<seek>, C<seekdir>, C<select>, +C<syscall>, C<sysread>, C<sysseek>, C<syswrite>, C<tell>, C<telldir>, +C<truncate>, C<warn>, C<write> =item Functions for fixed-length data or records -C<pack>, C<read>, C<syscall>, C<sysread>, C<syswrite>, C<unpack>, C<vec> +C<pack>, C<read>, C<syscall>, C<sysread>, C<sysseek>, C<syswrite>, C<unpack>, +C<vec> =item Functions for filehandles, files, or directories X<file> X<filehandle> X<directory> X<pipe> X<link> X<symlink> @@ -164,7 +165,7 @@ X<control flow> C<caller>, C<continue>, C<die>, C<do>, C<dump>, C<eval>, C<evalbytes> C<exit>, C<__FILE__>, C<goto>, C<last>, C<__LINE__>, C<next>, C<__PACKAGE__>, -C<redo>, C<return>, C<sub>, C<__SUB__>, C<wantarray> +C<prototype>, C<redo>, C<return>, C<sub>, C<__SUB__>, C<wantarray> C<__SUB__> is only available with a C<use v5.16> (or higher) declaration or with the C<"current_sub"> feature (see L<feature>). @@ -191,7 +192,7 @@ L<feature>. Alternately, include a C<use v5.10> or later to the current scope. =item Miscellaneous functions C<defined>, C<dump>, C<eval>, C<evalbytes>, -C<formline>, C<local>, C<my>, C<our>, +C<formline>, C<local>, C<lock>, C<my>, C<our>, C<prototype>, C<reset>, C<scalar>, C<state>, C<undef>, C<wantarray> =item Functions for processes and process groups @@ -4674,6 +4675,11 @@ components. You should set C<$VERSION> only once per package. See L<perlmod/"Packages"> for more information about packages, modules, and classes. See L<perlsub> for other scoping issues. +=item __PACKAGE__ +X<__PACKAGE__> + +A special token that returns the name of the package in which it occurs. + =item pipe READHANDLE,WRITEHANDLE X<pipe> @@ -4691,11 +4697,6 @@ On systems that support a close-on-exec flag on files, that flag is set on all newly opened file descriptors whose C<fileno>s are I<higher> than the current value of $^F (by default 2 for C<STDERR>). See L<perlvar/$^F>. -=item __PACKAGE__ -X<__PACKAGE__> - -A special token that returns the name of the package in which it occurs. - =item pop ARRAY X<pop> X<stack> @@ -4860,10 +4861,10 @@ a recent vintage: =item qq/STRING/ -=item qx/STRING/ - =item qw/STRING/ +=item qx/STRING/ + Generalized quotes. See L<perlop/"Quote-Like Operators">. =item qr/STRING/ -- Perl5 Master Repository
