$fd = POSIX::open( "foo", &POSIX::O_RDONLY ) This uses file descriptors such as those obtained by calling POSIX::open. This is identical to the C function clock(), returning the amount of spent processor time in microseconds. Use the method IO::Handle::clearerr() instead, to reset the error state (if any) and EOF state (if any) of the given stream. This is identical to Perl's builtin chown() function, allowing one to change file and directory owners and groups, see "chown" in perlfunc. $c = POSIX::chmod 0664, $file1, $file2 # throws exceptionĪs with the built-in chmod(), $file may be a filename or a file handle. $c = POSIX::chmod 0664, $file1 # throws exception This is identical to Perl's builtin chmod() function, allowing one to change file and directory permissions - see "chmod" in perlfunc - with the exception that POSIX::chmod() can only change one file at a time (rather than a list of files): $c = chmod 0664, $file1, $file2 # good $rv = POSIX::chdir() # throws exception # chmod This is identical to Perl's builtin chdir() function, allowing one to change the working (default) directory - see "chdir" in perlfunc - with the exception that POSIX::chdir() must be provided an explicit value (rather than relying on an implicit $_): $rv = POSIX::chdir('path/to/dir') # good This is identical to the C function ceil(), returning the smallest integer value greater than or equal to the given numerical argument. Perl does memory management transparently. For doing binary search on wordlists, see Search::Dict. If you need to have just the integer part, see "int" in perlfunc. If you need to force a scalar to a number, add a zero to it. Perl converts strings to numbers transparently. For example, trying to access the setjmp() call will elicit the message " setjmp() is C-specific: use eval instead, see perlmod. If you attempt to call these, they will print a message telling you that they aren't implemented, and suggest using the Perl equivalent, should one exist. If you do neither and opt for the default (as in use POSIX ), you will import hundreds and hundreds of symbols into your namespace.Ī few functions are not implemented because they are C specific. POSIX::SEEK_END), or give an explicit import list. You should either prevent the exporting (by saying use POSIX (), as usual) and then use fully qualified names (e.g. This is an unfortunate backwards compatibility feature and its use is strongly discouraged. #CAVEATSĮverything is exported by default (with a handful of exceptions). Attempts to use any missing one will result in a fatal runtime error message. Some may not be available on your system if it adheres to an earlier standard. The notation indicates functions that were added in the ISO/IEC 9899:1999 version of the C language standard. The remaining sections list various constants and macros in an organization which roughly follows IEEE Std 1003.1b-1993. The second section describes some classes for signal objects, TTY objects, and other miscellaneous objects. The first section describes POSIX functions from the 1003.1 specification. Consult perlfunc for functions which are noted as being identical or almost identical to Perl's builtin functions. Consult your operating system's manpages for general information on most features. This document gives a condensed list of the features available in the POSIX module. Many of these identifiers have been given Perl-ish interfaces. The POSIX module permits you to access all (or nearly all) the standard POSIX 1003.1 identifiers. # note: that's a filedescriptor, *NOT* a filehandle #DESCRIPTION POSIX - Perl interface to IEEE Std 1003.1 #SYNOPSIS use POSIX ()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |