From: Gurusamy Sarathy Date: Tue, 21 Jul 1998 03:06:04 +0000 (+0000) Subject: documentation tweaks from Abigail X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f86cebdf4bf70402819a0aa8a00fe9714274e586;p=p5sagit%2Fp5-mst-13.2.git documentation tweaks from Abigail Date: Fri, 17 Jul 1998 20:52:36 -0400 (EDT) Message-ID: <19980718005236.5154.qmail@betelgeuse.wayne.fnx.com> Subject: Re: [PATCH 5.00475] pod/perlsyn.pod -- Date: Thu, 16 Jul 1998 17:00:49 -0400 (EDT) Message-ID: <19980716210049.16156.qmail@betelgeuse.wayne.fnx.com> Subject: [PATCH 5.00475] pod/perlguts.pod -- Date: Thu, 16 Jul 1998 16:52:05 -0400 (EDT) Message-ID: <19980716205205.15949.qmail@betelgeuse.wayne.fnx.com> Subject: [PATCH 5.00475] Tweaking pod/perlfunc.pod -- Date: Fri, 17 Jul 1998 22:58:05 -0400 (EDT) Message-ID: <19980718025805.7135.qmail@betelgeuse.wayne.fnx.com> Subject: [PATCH, 5.00475], pod/perlsub.pod -- Date: Sat, 18 Jul 1998 04:02:00 -0400 (EDT) Message-ID: <19980718080200.9927.qmail@betelgeuse.wayne.fnx.com> Subject: [PATCH 5.00475] pod/perlfunc.pod p4raw-id: //depot/perl@1590 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index abef92e..8c3451f 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -71,7 +71,7 @@ there, not the list construction version of the comma. That means it was never a list to start with. In general, functions in Perl that serve as wrappers for system calls -of the same name (like C, C, C, etc.) all return +of the same name (like chown(2), fork(2), closedir(2), etc.) all return true when they succeed and C otherwise, as is usually mentioned in the descriptions below. This is different from the C interfaces, which return C<-1> on failure. Exceptions to this rule are C, @@ -320,7 +320,7 @@ If VALUE is omitted, uses C<$_>. =item accept NEWSOCKET,GENERICSOCKET -Accepts an incoming socket connect, just as the C system call +Accepts an incoming socket connect, just as the accept(2) system call does. Returns the packed address if it succeeded, FALSE otherwise. See example in L. @@ -339,24 +339,24 @@ starting a new one. The returned value is the amount of time remaining on the previous timer. For delays of finer granularity than one second, you may use Perl's -C interface to access C if your system supports it, +C interface to access setitimer(2) if your system supports it, or else see L. It is usually a mistake to intermix C and C calls. If you want to use C to time out a system call you need to use an C/C pair. You can't rely on the alarm causing the system call to -fail with C<$!> set to EINTR because Perl sets up signal handlers to +fail with C<$!> set to C because Perl sets up signal handlers to restart system calls on some systems. Using C/C always works, modulo the caveats given in L. eval { - local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required + local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required alarm $timeout; $nread = sysread SOCKET, $buffer, $size; alarm 0; }; if ($@) { - die unless $@ eq "alarm\n"; # propagate unexpected errors + die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out } else { @@ -458,7 +458,8 @@ successfully changed. See also L, if all you have is a string. $cnt = chmod 0755, 'foo', 'bar'; chmod 0755, @executables; - $mode = '0644'; chmod $mode, 'foo'; # !!! sets mode to --w----r-T + $mode = '0644'; chmod $mode, 'foo'; # !!! sets mode to + # --w----r-T $mode = '0644'; chmod oct($mode), 'foo'; # this is better $mode = 0644; chmod $mode, 'foo'; # this is best @@ -659,7 +660,7 @@ function, or use this relation: =item crypt PLAINTEXT,SALT -Encrypts a string exactly like the C function in the C library +Encrypts a string exactly like the crypt(3) function in the C library (assuming that you actually have a version there that has not been extirpated as a potential munition). This can prove useful for checking the password file for lousy passwords, amongst other things. Only the @@ -922,11 +923,12 @@ You might like to use C to read in a program configuration file. Manual error checking can be done this way: # read in config files: system first, then user - for $file ('/share/prog/defaults.rc", "$ENV{HOME}/.someprogrc") { + for $file ("/share/prog/defaults.rc", + "$ENV{HOME}/.someprogrc") { unless ($return = do $file) { - warn "couldn't parse $file: $@" if $@; - warn "couldn't do $file: $!" unless defined $return; - warn "couldn't run $file" unless $return; + warn "couldn't parse $file: $@" if $@; + warn "couldn't do $file: $!" unless defined $return; + warn "couldn't run $file" unless $return; } } @@ -937,7 +939,7 @@ use the B program to turn your core dump into an executable binary after having initialized all your variables at the beginning of the program. When the new binary is executed it will begin by executing a C (with all the restrictions that C suffers). Think of -it as a goto with an intervening core dump and reincarnation. If LABEL +it as a goto with an intervening core dump and reincarnation. If C