diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-08 19:42:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-08 19:42:57 +0000 |
commit | 91500cfd5c426b5ce4db817d5b64c763d5b8822b (patch) | |
tree | 06148df1f82ee7bb548fabecb07061ebe03438e5 /pod | |
parent | 4771b018b5cdc984c08bd1fd014895ea804ec3f0 (diff) | |
parent | 3541dd58afee4802e6d8771e6ed02e20cc107e31 (diff) | |
download | perl-91500cfd5c426b5ce4db817d5b64c763d5b8822b.tar.gz |
integrate cfgperl changes into mainline
p4raw-id: //depot/perl@2219
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 141 | ||||
-rw-r--r-- | pod/perllocale.pod | 15 | ||||
-rw-r--r-- | pod/perlport.pod | 45 |
3 files changed, 150 insertions, 51 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 5a9543ff45..766b060c8a 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -135,8 +135,10 @@ C<unlink>, C<utime> =item Keywords related to the control flow of your perl program -C<caller>, C<continue>, C<die>, C<do>, C<dump>, C<eval>, C<exit>, -C<goto>, C<last>, C<next>, C<redo>, C<return>, C<sub>, C<wantarray> +C<caller>, C<continue>, C<die>, C<do>, C<dump>, C<else>, C<elsif>, +C<eval>, C<exit>, C<for>, C<foreach>, C<goto>, C<if>, C<last>, +C<next>, C<redo>, C<return>, C<sub>, C<unless>, C<wantarray>, +C<while>, C<until> =item Keywords related to scoping @@ -671,14 +673,14 @@ L<perlipc/"Sockets: Client/Server Communication">. =item continue BLOCK Actually a flow control statement rather than a function. If there is a -C<continue> BLOCK attached to a BLOCK (typically in a C<while> or -C<foreach>), it is always executed just before the conditional is about to -be evaluated again, just like the third part of a C<for> loop in C. Thus +C<continue> BLOCK attached to a BLOCK (typically in a L<(while> or +L</foreach>), it is always executed just before the conditional is about to +be evaluated again, just like the third part of a L</for> loop in C. Thus it can be used to increment a loop variable, even when the loop has been continued via the C<next> statement (which is similar to the C C<continue> statement). -C<last>, C<next>, or C<redo> may appear within a C<continue> +L</last>, L</next>, or L</redo> may appear within a C<continue> block. C<last> and C<redo> will behave as if they had been executed within the main block. So will C<next>, but since it will execute a C<continue> block, it may be more entertaining. @@ -697,6 +699,8 @@ Omitting the C<continue> section is semantically equivalent to using an empty one, logically enough. In that case, C<next> goes directly back to check the condition at the top of the loop. +See also L<perlsyn>. + =item cos EXPR Returns the cosine of EXPR (expressed in radians). If EXPR is omitted, @@ -942,11 +946,12 @@ as the first line of the handler (see L<perlvar/$^S>). Not really a function. Returns the value of the last command in the sequence of commands indicated by BLOCK. When modified by a loop -modifier, executes the BLOCK once before testing the loop condition. -(On other statements the loop modifiers test the conditional first.) +modifier such as L</while> or L</until>, executes the BLOCK once +before testing the loop condition. (On other statements the loop +modifiers test the conditional first.) C<do BLOCK> does I<not> count as a loop, so the loop control statements -C<next>, C<last> or C<redo> cannot be used to leave or restart the block. +L</next>, L</last> or L</redo> cannot be used to leave or restart the block. =item do SUBROUTINE(LIST) @@ -1061,6 +1066,12 @@ only in a different order: See also C<keys()> and C<values()>. +=item else BLOCK + +=item elsif (EXPR) BLOCK + +See L</if>. + =item eof FILEHANDLE =item eof () @@ -1432,6 +1443,38 @@ Here's a mailbox appender for BSD systems. See also L<DB_File> for other flock() examples. +=item for (INITIAL; WHILE; EACH) BLOCK + +Do INITIAL, enter BLOCK while EXPR is true, at the end of each round +do EACH. For example: + + for ($i = 0, $j = 0; $i < 10; $i++) { + if ($i % 3 == 0) { $j++ } + print "i = $i, j = $j\n"; + } + +See L<perlsyn> for more details. See also L</foreach>, a twin of +C<for>, L</while> and L</until>, close cousins of L<for>, and +L</last>, L</next>, and L</redo> for additional control flow. + +=item foreach LOOPVAR (LIST) BLOCK + +Enter BLOCK as LOOPVAR set in turn to each element of LIST. +For example: + + foreach $rolling (@stones) { print "rolling $stone\n" } + + foreach my $file (@files) { print "file $file\n" } + +The LOOPVAR is optional and defaults to C<$_>. If the elements are +modifiable (as opposed to constants or tied variables) you can modify them. + + foreach (@words) { tr/abc/xyz/ } + +See L<perlsyn> for more details. See also L</for>, a twin of +C<foreach>, L</while> and L</until>, close cousins of L<for>, and +L</last>, L</next>, and L</redo> for additional control flow. + =item fork Does a fork(2) system call. Returns the child pid to the parent process, @@ -1838,6 +1881,21 @@ see L</oct>.) If EXPR is omitted, uses C<$_>. print hex '0xAf'; # prints '175' print hex 'aF'; # same +=item if (EXPR) BLOCK + +=item if (EXPR) BLOCK else BLOCK2 + +=item if (EXPR) BLOCK elsif (EXPR2) BLOCK2 + +Enter BLOCKs conditionally. The first EXPR to return true +causes the corresponding BLOCK to be entered, or, in the case +of C<else>, the fall-through default BLOCK. + +Take notice: Perl wants BLOCKS, expressions (like e.g. in C, C++, or +Pascal) won't do. + +See L<perlsyn> for more details. See also C<unless>. + =item import There is no builtin C<import()> function. It is just an ordinary @@ -1999,8 +2057,10 @@ C<continue> block, if any, is not executed: C<last> cannot be used to exit a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>. -See also L</continue> for an illustration of how C<last>, C<next>, and -C<redo> work. +See also L</continue> for an illustration of how C<last>, L</next>, and +L</redo> work. + +See also L<perlsyn>. =item lc EXPR @@ -2210,8 +2270,10 @@ refers to the innermost enclosing loop. C<next> cannot be used to exit a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>. -See also L</continue> for an illustration of how C<last>, C<next>, and -C<redo> work. +See also L</continue> for an illustration of how L</last>, C<next>, and +L</redo> work. + +See also L<perlsyn>. =item no Module LIST @@ -2502,6 +2564,12 @@ follows: (These 'shorts' and 'longs' are _exactly_ 16 bits and _exactly_ 32 bits, respectively.) + q A signed quad (64-bit) value. + Q An unsigned quad value. + (Available only if your system supports 64-bit integer values + _and_ if Perl has been compiled to support those. + Causes a fatal error otherwise.) + f A single-precision float in the native format. d A double-precision float in the native format. @@ -2825,7 +2893,7 @@ See L<perlipc/"UDP: Message Passing"> for examples. =item redo The C<redo> command restarts the loop block without evaluating the -conditional again. The C<continue> block, if any, is not executed. If +conditional again. The L</continue> block, if any, is not executed. If the LABEL is omitted, the command refers to the innermost enclosing loop. This command is normally used by programs that want to lie to themselves about what was just input: @@ -2850,9 +2918,11 @@ themselves about what was just input: C<redo> cannot be used to retry a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>. -See also L</continue> for an illustration of how C<last>, C<next>, and +See also L</continue> for an illustration of how L</last>, L</next>, and C<redo> work. +See also L<perlsyn>. + =item ref EXPR =item ref @@ -3921,8 +3991,8 @@ system-dependent; they are available via the standard module C<Fcntl>. For historical reasons, some values work on almost every system supported by perl: zero means read-only, one means write-only, and two means read/write. We know that these values do I<not> work under -OS/390 Unix and on the Macintosh; you probably don't want to use them -in new code. +OS/390 & VM/ESA Unix and on the Macintosh; you probably don't want to +use them in new code. If the file named by FILENAME does not exist and the C<open()> call creates it (typically because MODE includes the C<O_CREAT> flag), then the value of @@ -4205,8 +4275,6 @@ not trying to restrict access for yourself, returns C<undef>. Remember that a umask is a number, usually given in octal; it is I<not> a string of octal digits. See also L</oct>, if all you have is a string. - - =item undef EXPR =item undef @@ -4233,6 +4301,13 @@ parameter. Examples: Note that this is a unary operator, not a list operator. +=item unless (EXPR) BLOCK + +The negative counterpart of L</if>. If the EXPR returns false the +BLOCK is entered. + +See also L<perlsyn>. + =item unlink LIST =item unlink @@ -4282,10 +4357,6 @@ The following efficiently counts the number of set bits in a bit vector: $setbits = unpack("%32b*", $selectmask); -=item untie VARIABLE - -Breaks the binding between a variable and a package. (See C<tie()>.) - =item unshift ARRAY,LIST Does the opposite of a C<shift()>. Or the opposite of a C<push()>, @@ -4298,6 +4369,21 @@ Note the LIST is prepended whole, not one element at a time, so the prepended elements stay in the same order. Use C<reverse()> to do the reverse. +=item until (EXPR) BLOCK + +=item do BLOCK until (EXPR) + +Enter BLOCK until EXPR returns false. The first form may avoid entering +the BLOCK, the second form enters the BLOCK at least once. + +See L</do>, L</while>, and L</for>. + +See also L<perlsyn>. + +=item untie VARIABLE + +Breaks the binding between a variable and a package. (See C<tie()>.) + =item use Module LIST =item use Module @@ -4514,6 +4600,15 @@ warnings (even the so-called mandatory ones). An example: See L<perlvar> for details on setting C<%SIG> entries, and for more examples. +=item while (EXPR) BLOCK + +=item do BLOCK while (EXPR) + +Enter BLOCK while EXPR is true. The first form may avoid entering the +BLOCK, the second form enters the BLOCK at least once. + +See also L<perlsyn>, L</for>, L</until>, and L</continue>. + =item write FILEHANDLE =item write EXPR diff --git a/pod/perllocale.pod b/pod/perllocale.pod index 0a85c0eb11..ba93f18edd 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -276,10 +276,10 @@ The two quickest fixes are either to render Perl silent about any locale inconsistencies or to run Perl under the default locale "C". Perl's moaning about locale problems can be silenced by setting the -environment variable PERL_BADLANG to a non-zero value, for example -"1". This method really just sweeps the problem under the carpet: you -tell Perl to shut up even when Perl sees that something is wrong. Do -not be surprised if later something locale-dependent misbehaves. +environment variable PERL_BADLANG to a zero value, for example "0". +This method really just sweeps the problem under the carpet: you tell +Perl to shut up even when Perl sees that something is wrong. Do not +be surprised if later something locale-dependent misbehaves. Perl can be run under the "C" locale by setting the environment variable LC_ALL to "C". This method is perhaps a bit more civilized @@ -785,9 +785,10 @@ of a match involving C<\w> while C<use locale> is in effect. A string that can suppress Perl's warning about failed locale settings at startup. Failure can occur if the locale support in the operating system is lacking (broken) in some way--or if you mistyped the name of -a locale when you set up your environment. If this environment variable -is absent, or has a value that does not evaluate to integer zero--that -is, "0" or ""--Perl will complain about locale setting failures. +a locale when you set up your environment. If this environment +variable is absent, or has a value that does not evaluate to integer +zero--that is, "0" or ""-- Perl will complain about locale setting +failures. B<NOTE>: PERL_BADLANG only gives you a way to hide the warning message. The message tells about some problem in your system's locale support, diff --git a/pod/perlport.pod b/pod/perlport.pod index fce35ac5a1..918827c9d7 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -799,15 +799,16 @@ the message body to majordomo@list.stratagy.com. =head2 EBCDIC Platforms Recent versions of Perl have been ported to platforms such as OS/400 on -AS/400 minicomputers as well as OS/390 for IBM Mainframes. Such computers -use EBCDIC character sets internally (usually Character Code Set ID 00819 -for OS/400 and IBM-1047 for OS/390). Note that on the mainframe perl -currently works under the "Unix system services for OS/390" (formerly -known as OpenEdition). +AS/400 minicomputers as well as OS/390 & VM/ESA for IBM Mainframes. Such +computers use EBCDIC character sets internally (usually Character Code +Set ID 00819 for OS/400 and IBM-1047 for OS/390 & VM/ESA). Note that on +the mainframe perl currently works under the "Unix system services +for OS/390" (formerly known as OpenEdition) and VM/ESA OpenEdition. -As of R2.5 of USS for OS/390 that Unix sub-system did not support the -C<#!> shebang trick for script invocation. Hence, on OS/390 perl scripts -can executed with a header similar to the following simple script: +As of R2.5 of USS for OS/390 and Version 2.3 of VM/ESA these Unix +sub-systems do not support the C<#!> shebang trick for script invocation. +Hence, on OS/390 and VM/ESA perl scripts can be executed with a header +similar to the following simple script: : # use perl eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' @@ -825,12 +826,13 @@ and C<|>, not to mention dealing with socket interfaces to ASCII computers Fortunately, most web servers for the mainframe will correctly translate the C<\n> in the following statement to its ASCII equivalent (note that -C<\r> is the same under both Unix and OS/390): +C<\r> is the same under both Unix and OS/390 & VM/ESA): print "Content-type: text/html\r\n\r\n"; The value of C<$^O> on OS/390 is "os390". +The value of C<$^O> on VM/ESA is "vmesa". Some simple tricks for determining if you are running on an EBCDIC platform could include any of the following (perhaps all): @@ -1094,7 +1096,7 @@ Does nothing, but won't fail. (Win32) =item chroot -Not implemented. (S<Mac OS>, Win32, VMS, Plan9, S<RISC OS>, VOS) +Not implemented. (S<Mac OS>, Win32, VMS, Plan9, S<RISC OS>, VOS, VM/ESA) =item crypt PLAINTEXT,SALT @@ -1123,6 +1125,7 @@ Invokes VMS debugger. (VMS) Not implemented. (S<Mac OS>) +Implemented via Spawn. (VM/ESA) =item fcntl FILEHANDLE,FUNCTION,SCALAR Not implemented. (Win32, VMS) @@ -1135,7 +1138,7 @@ Available only on Windows NT (not on Windows 95). (Win32) =item fork -Not implemented. (S<Mac OS>, Win32, AmigaOS, S<RISC OS>, VOS) +Not implemented. (S<Mac OS>, Win32, AmigaOS, S<RISC OS>, VOS, VM/ESA) =item getlogin @@ -1151,7 +1154,7 @@ Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>) =item getpriority WHICH,WHO -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) +Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS, VM/ESA) =item getpwnam NAME @@ -1191,11 +1194,11 @@ Not implemented. (S<Mac OS>) =item getpwent -Not implemented. (S<Mac OS>, Win32) +Not implemented. (S<Mac OS>, Win32, VM/ESA) =item getgrent -Not implemented. (S<Mac OS>, Win32, VMS) +Not implemented. (S<Mac OS>, Win32, VMS, VM/ESA) =item gethostent @@ -1239,11 +1242,11 @@ Not implemented. (Plan9, Win32, S<RISC OS>) =item endpwent -Not implemented. (S<Mac OS>, Win32) +Not implemented. (S<Mac OS>, Win32, VM/ESA) =item endgrent -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>) +Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VM/ESA) =item endhostent @@ -1379,7 +1382,7 @@ Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) =item socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) +Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS, VM/ESA) =item stat FILEHANDLE @@ -1403,14 +1406,14 @@ Not implemented. (Win32, VMS, S<RISC OS>) =item syscall LIST -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) +Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS, VM/ESA) =item sysopen FILEHANDLE,FILENAME,MODE,PERMS The traditional "0", "1", and "2" MODEs are implemented with different numeric values on some systems. The flags exported by C<Fcntl> (O_RDONLY, O_WRONLY, O_RDWR) should work everywhere though. (S<Mac -OS>, OS/390) +OS>, OS/390, VM/ESA) =item system LIST @@ -1519,8 +1522,10 @@ Tom Christiansen E<lt>tchrist@perl.comE<gt>, Nicholas Clark E<lt>Nicholas.Clark@liverpool.ac.ukE<gt>, Andy Dougherty E<lt>doughera@lafcol.lafayette.eduE<gt>, Dominic Dunlop E<lt>domo@vo.luE<gt>, +Neale Ferguson E<lt>neale@mailbox.tabnsw.com.auE<gt> Paul Green E<lt>Paul_Green@stratus.comE<gt>, M.J.T. Guy E<lt>mjtg@cus.cam.ac.ukE<gt>, +Jarkko Hietaniemi E<lt>jhi@iki.fi<gt>, Luther Huffman E<lt>lutherh@stratcom.comE<gt>, Nick Ing-Simmons E<lt>nick@ni-s.u-net.comE<gt>, Andreas J. KE<ouml>nig E<lt>koenig@kulturbox.deE<gt>, @@ -1543,5 +1548,3 @@ This document is maintained by Chris Nandor. Version 1.35, last modified 09 September 1998. - - |