X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=c1efce7b8506a454bfafa29e0e406894b8e1ca53;hb=8939ba947b65b018b80ecab3fe1366287d07d1d7;hp=52de7fd3247b8c83d2dc7d01bc21a131c55c4bde;hpb=a8ad0e08f7df8b74e6a4447340482563749898fb;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 52de7fd..c1efce7 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -457,7 +457,7 @@ name of the filehandle. DISCIPLINE can be either of C<:raw> for binary mode or C<:crlf> for "text" mode. If the DISCIPLINE is omitted, it defaults to C<:raw>. Returns true on success, C on failure. To mark FILEHANDLE as -UTF-8, use C<:utf8>, and to mark the as bytes, use C<:bytes>. +UTF-8, use C<:utf8>, and to mark it as bytes, use C<:bytes>. The C<:raw> are C<:clrf>, and any other directives of the form C<:...>, are called I/O I. The C pragma can be @@ -554,11 +554,13 @@ C<$is_require> are set: C<$is_require> is true if the frame is created by a C or C statement, $evaltext contains the text of the C statement. In particular, for an C statement, $filename is C<(eval)>, but $evaltext is undefined. (Note also that -each C statement creates a C frame inside an C) -frame. C<$hasargs> is true if a new instance of C<@_> was set up for the -frame. C<$hints> and C<$bitmask> contain pragmatic hints that the caller -was compiled with. The C<$hints> and C<$bitmask> values are subject to -change between versions of Perl, and are not meant for external use. +each C statement creates a C frame inside an C +frame.) $subroutine may also be C<(unknown)> if this particular +subroutine happens to have been deleted from the symbol table. +C<$hasargs> is true if a new instance of C<@_> was set up for the frame. +C<$hints> and C<$bitmask> contain pragmatic hints that the caller was +compiled with. The C<$hints> and C<$bitmask> values are subject to change +between versions of Perl, and are not meant for external use. Furthermore, when called from within the DB package, caller returns more detailed information: it sets the list variable C<@DB::args> to be the @@ -1087,7 +1089,7 @@ This is useful for propagating exceptions: If LIST is empty and C<$@> contains an object reference that has a C method, that method will be called with additional file and line number parameters. The return value replaces the value in -C<$@>. ie. as if C<<$@ = eval { $@->PROPAGATE(__FILE__, __LINE__) };>> +C<$@>. ie. as if C<<$@ = eval { $@->PROPAGATE(__FILE__, __LINE__) };>> were called. If C<$@> is empty then the string C<"Died"> is used. @@ -1278,7 +1280,7 @@ formed from the files listed on the command line and accessed via the C<< <> >> operator. Since C<< <> >> isn't explicitly opened, as a normal filehandle is, an C before C<< <> >> has been used will cause C<@ARGV> to be examined to determine if input is -available. Similarly, an C after C<< <> >> has returned +available. Similarly, an C after C<< <> >> has returned end-of-file will assume you are processing another C<@ARGV> list, and if you haven't set C<@ARGV>, will read input from C; see L. @@ -2467,12 +2469,13 @@ and the month of the year, may not necessarily be three characters wide. =item lock THING -This function places an advisory lock on a variable, subroutine, -or referenced object contained in I until the lock goes out -of scope. This is a built-in function only if your version of Perl -was built with threading enabled, and if you've said C. -Otherwise a user-defined function by this name will be called. -See L. +This function places an advisory lock on a shared variable, or referenced +object contained in I until the lock goes out of scope. + +lock() is a "weak keyword" : this means that if you've defined a function +by this name (before any calls to it), that function will be called +instead. (However, if you've said C, lock() is always a +keyword.) See L. =item log EXPR @@ -2713,7 +2716,7 @@ strict 'refs'> should I be in effect.) 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 to open.) +using C, specify EXPR in your call to open.) If three or more arguments are specified then the mode of opening and the file name are separate. If MODE is C<< '<' >> or nothing, the file @@ -2784,7 +2787,7 @@ If you're running Perl on a system that distinguishes between text files and binary files, then you should check out L for tips for 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 +like Unix, Mac OS, and Plan 9, 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. @@ -2887,7 +2890,7 @@ C using various methods: #!/usr/bin/perl open my $oldout, ">&STDOUT" or die "Can't dup STDOUT: $!"; open OLDERR, ">&", \*STDERR or die "Can't dup STDERR: $!"; - + open STDOUT, '>', "foo.out" or die "Can't redirect STDOUT: $!"; open STDERR, ">&STDOUT" or die "Can't dup STDOUT: $!"; @@ -4249,6 +4252,9 @@ You can effect a sleep of 250 milliseconds this way: select(undef, undef, undef, 0.25); +Note that whether C, except as permitted by POSIX, and even then only on POSIX systems. You have to use C instead. @@ -4960,7 +4966,7 @@ Most programs won't even call srand() at all, except those that need a cryptographically-strong starting point rather than the generally acceptable default, which is based on time of day, process ID, and memory allocation, or the F device, -if available. +if available. You can call srand($seed) with the same $seed to reproduce the I sequence from rand(), but this is usually reserved for @@ -5607,7 +5613,7 @@ package. =item time Returns the number of non-leap seconds since whatever time the system -considers to be the epoch (that's 00:00:00, January 1, 1904 for MacOS, +considers to be the epoch (that's 00:00:00, January 1, 1904 for Mac OS, and 00:00:00 UTC, January 1, 1970 for most other systems). Suitable for feeding to C and C. @@ -5907,8 +5913,6 @@ by C, i.e., it calls C instead of C. no strict 'refs'; no warnings; -If no C method can be found the call fails with a fatal error. - See L for a list of standard modules and pragmas. See L for the C<-M> and C<-m> command-line options to perl that give C functionality from the command-line.