X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=6af9f8de9f91c08b0cac882d5cb2d74413c82514;hb=a1021d57870f2cf967a704182b47a5defa79a0f1;hp=49eb72921d23f2b741cd1c5848939d667b94ccc5;hpb=b0169937a1833d262bdcef83fc6595ccc076cb56;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 49eb729..6af9f8d 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -492,7 +492,8 @@ function, or use the familiar relation: sub tan { sin($_[0]) / cos($_[0]) } -Note that atan2(0, 0) is not well-defined. +The return value for C is implementation-defined; consult +your atan2(3) manpage for more information. =item bind SOCKET,NAME X @@ -1625,6 +1626,22 @@ normally you I like to use double quotes, except that in this particular situation, you can just use symbolic references instead, as in case 6. +The assignment to C<$@> occurs before restoration of localised variables, +which means a temporary is required if you want to mask some but not all +errors: + + # alter $@ on nefarious repugnancy only + { + my $e; + { + local $@; # protect existing $@ + eval { test_repugnancy() }; + # $@ =~ /nefarious/ and die $@; # DOES NOT WORK + $@ =~ /nefarious/ and $e = $@; + } + die $e if defined $e + } + C does I count as a loop, so the loop control statements C, C, or C cannot be used to leave or restart the block. @@ -2667,9 +2684,10 @@ X X =item length Returns the length in I of the value of EXPR. If EXPR is -omitted, returns length of C<$_>. Note that this cannot be used on -an entire array or hash to find out how many elements these have. -For that, use C and C respectively. +omitted, returns length of C<$_>. If EXPR is undefined, returns C. +Note that this cannot be used on an entire array or hash to find out how +many elements these have. For that, use C and C respectively. Note the I: if the EXPR is in Unicode, you will get the number of characters, not the number of bytes. To get the length @@ -2749,7 +2767,8 @@ Wednesday. C<$yday> is the day of the year, in the range C<0..364> C<$isdst> is true if the specified time occurs during Daylight Saving Time, false otherwise. -If EXPR is omitted, C uses the current time (C). +If EXPR is omitted, C uses the current time (as returned +by time(3)). In scalar context, C returns the ctime(3) value: @@ -4060,12 +4079,6 @@ If the package name is null, the C
package as assumed. That is, C<$::sail> is equivalent to C<$main::sail> (as well as to C<$main'sail>, still seen in older code). -If NAMESPACE is omitted, then there is no current package, and all -identifiers must be fully qualified or lexicals. However, you are -strongly advised not to make use of this feature. Its use can cause -unexpected behaviour, even crashing some versions of Perl. It is -deprecated, and will be removed from a future release. - See L for more information about packages, modules, and classes. See L for other scoping issues. @@ -5101,6 +5114,10 @@ It's also a more insistent form of close because it also disables the file descriptor in any forked copies in other processes. +Returns C<1> for success. In the case of error, returns C if +the first argument is not a valid filehandle, or returns C<0> and sets +C<$!> for any other failure. + =item sin EXPR X X X X @@ -5600,8 +5617,8 @@ to take the arguments out of order, e.g.: one or more of: - space prefix positive number with a space - + prefix positive number with a plus sign + space prefix non-negative number with a space + + prefix non-negative number with a plus sign - left-justify within the field 0 use zeros, not spaces, to right-justify # ensure the leading "0" for any octal, @@ -6873,22 +6890,16 @@ of perl older than the specified one. Specifying VERSION as a literal of the form v5.6.1 should generally be avoided, because it leads to misleading error messages under earlier -versions of Perl that do not support this syntax. The equivalent numeric -version should be used instead. - -Alternatively, you can use a numeric version C followed by a -v-string version like C, to avoid the unintuitive C. (older perl versions fail gracefully at the first C, -later perl versions understand the v-string syntax in the second). +versions of Perl (that is, prior to 5.6.0) that do not support this +syntax. The equivalent numeric version should be used instead. use v5.6.1; # compile time version check use 5.6.1; # ditto use 5.006_001; # ditto; preferred for backwards compatibility - use 5.006; use 5.6.1; # ditto, for compatibility and readability This is often useful if you need to check the current Perl version before -Cing library modules that have changed in incompatible ways from -older versions of Perl. (We try not to do this more than we have to.) +Cing library modules that won't work with older versions of Perl. +(We try not to do this more than we have to.) Also, if the specified perl version is greater than or equal to 5.9.5, C will also load the C pragma and enable all