1. Trang chủ
  2. » Công Nghệ Thông Tin

Perl in a Nutshell phần 7 ppt

72 353 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 72
Dung lượng 6,45 MB

Nội dung

siglongjmp C-specific; use Perl's die function sigpending Examines blocked, pending signals and returns undef on failure sigprocmask Changes and/or examines this process's signal mask; returns undef on failure sigsetjmp C-specific; use eval {} sigsuspend Installs signal mask and suspends process until signal arrives; returns undef on failure sin Identical to Perl's sin function sinh Identical to C function sinh(3) sleep Identical to Perl's sleep function sprintf Identical to Perl's sprintf function sqrt Identical to Perl's sqrt function srand Identical to Perl's srand function sscanf C-specific; use regular expressions stat Identical to Perl's stat function strcat C-specific; use .= strchr C-specific; use index strcmp C-specific; use eq strcoll Identical to C function strcoll(3) strcpy C-specific; use = strcspn C-specific; use regular expressions strerror Returns error string for the specified errno strftime Converts date and time to string and returns the string strlen C-specific; use length strncat C-specific; use .= and/or substr strncmp C-specific; use eq and/or substr strncpy C-specific; use = and/or substr stroul C-specific strpbrk C-specific strrchr C-specific; use rindex and/or substr strspn C-specific strstr Identical to Perl's index function strtod C-specific strtok C-specific strtol C-specific strtoul C-specific strxfrm String transformation; returns the transformed string [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (6 of 11) [2/7/2001 10:34:14 PM] sysconf Retrieves values of system configurable variables; returns undef on failure system Identical to Perl's system function tan Identical to C function tan(3) tanh Identical to C function tanh(3) tcdrain Similar to C function tcdrain(3); returns undef on failure tcflow Similar to C function tcflow(3); returns undef on failure tcflush Similar to C function tcflush(3); returns undef on failure tcgetpgrp Identical to C function tcgetpgrp(3) tcsendbreak Similar to C function tcsendbreak(3); returns undef on failure tcsetpgrp Similar to C function tcsetpgrp(3); returns undef on failure time Identical to Perl's time function times Returns, in clock ticks, elapsed realtime since some point in the past, user and system times for this process, and user and system times for child processes tmpfile Uses method FileHandle::new_tmpfile tmpnam Returns a name for a temporary file tolower Identical to Perl's lc function toupper Identical to Perl's uc function ttyname Identical to C function ttyname(3) tzname Retrieves time conversion information from the tzname variable tzset Identical to C function tzset(3) umask Identical to Perl's umask function uname Gets name of current operating system ungetc Uses method FileHandle::ungetc unlink Identical to Perl's unlink function utime Identical to Perl's utime function vfprintf C-specific vprintf C-specific vsprintf C-specific wait Identical to Perl's wait function waitpid Waits for child process to change state; identical to Perl's waitpid function wcstombs Identical to C function wcstombs(3) wctomb Identical to C function wctomb(3) write Writes to file; returns undef on failure The following sections show the classes that are defined and their methods: [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (7 of 11) [2/7/2001 10:34:14 PM] 8.123.1 POSIX::SigAction new● 8.123.2 POSIX::SigSet new● addset● delset● emptyset● fillset● ismember● 8.123.3 POSIX::Termios new● getattr● getcc● getcflag● getiflag● getispeed● getlflag● getoflag● getospeed● setattr● setcc● setcflag● setiflag● setispeed● setlflag● setoflag● setospeed● 8.123.4 Constants The following constants are associated with the Termios class: Baud rate values B0 B75 B134 B200 B600 B1800 B4800 B19200 B50 B110 B150 B300 B1200 B2400 B9600 B38400 c_cc index values VEOF VERASE VKILL VSUSP VSTOP VTIME [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (8 of 11) [2/7/2001 10:34:14 PM] VEOL VINTR VQUIT VSTART VMIN NCCS c_cflag field values CLOCAL CSIZE CS6 CS8 HUPCL PARODD CREAD CS5 CS7 CSTOPS PARENB c_iflag field values BRKINT IGNBRK IGNPAR INPCK IXOFF PARMRK ICRNL IGNCR INLCR ISTRIP IXON c_lflag field values ECHO ECHONL ISIG ECHOE ICANON NOFLSH ECHOK IEXTEN TOSTOP c_oflag field values OPOST Terminal interface values TCSADRAIN TCIOFLUSH TCIFLUSH TCSANOW TCOFLUSH TCSAFLUSH TCOON TCION TCIOFF The following are other constants defined in the POSIX module: Pathname constants _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE POSIX constants _POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION System configuration _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION Error constants E2BIG EACCES EAGAIN EBADF EBUSY ECHILD EDEADLK EDOM EEXIST EFAUL EFBIG EINTR EINVAL EIO EISDIR EMFILE EMLINK ENAMETOOLONG ENFILE ENODE ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS ENOTDIR ENOTEMPTY ENOTTY ENXIO EPERM EPIPE ERANGE EROFS ESPIPE ESRCH EXDEV File control constants FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (9 of 11) [2/7/2001 10:34:14 PM] F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY Floating-point constants DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP Limit constants ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX Locale constants LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME Math constants HUGE_VAL Signal constants SA_NOCLDSTOP SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK Stat constants S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR Stat macros S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG Stdlib constants EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX Stdio constants BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX Time constants CLK_TCK CLOCKS_PER_SEC Unistd constants R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STRERR_FILENO W_OK X_OK Wait constants WNOHANG WUNTRACED [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (10 of 11) [2/7/2001 10:34:14 PM] Wait macros WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG 8.122 Pod::Text 8.124 re [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] [Chapter 8] 8.123 POSIX http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_123.htm (11 of 11) [2/7/2001 10:34:14 PM] Chapter 8 Standard Modules 8.124 re Pragma that lets you alter the behavior of regular expressions. Permits the following alterations: use re 'debug' Causes Perl to produce debugging messages when compiling and at run time when using regular expressions. See the re manpage and the section on "Debugging regular expressions" in the perldebug manpage for details. use re 'eval' Permits a regular expression to contain (?{ }) zero-width assertion even if the regular expression contains variable interpolation, which normally isn't permitted for security reasons. The pragma is ignored if the regular expression comes from tainted data. use re 'taint' When a tainted string is the target of a regular expression, causes the regular expression memories (or the values returned by the m// operator in list context) to be tainted. 8.123 POSIX 8.125 Safe [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] [Chapter 8] 8.124 re http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_124.htm [2/7/2001 10:34:16 PM] Chapter 8 Standard Modules 8.125 Safe Creates compartments for evaluating untrusted Perl code. Each compartment has an associated operator mask for excluding particular Perl operators from the compartment. See the Opcode module for more information on operators and operator masks. The default mask is applied during compilation to prevent all operations that give access to the system. Safe provides the following methods: new● mask● rdo● reval● root● share● trap● untrap● varglob● The following subroutines are available for export by Safe. The operator names can be found in the array op_name in the file opcode.h in the Perl distribution. emptymask● fullmask● mask_to_ops● MAXO● opcode● op_mask● opname● ops_to_mask● [Chapter 8] 8.125 Safe http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_125.htm (1 of 2) [2/7/2001 10:34:19 PM] 8.124 re 8.126 SDBM_File [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] [Chapter 8] 8.125 Safe http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_125.htm (2 of 2) [2/7/2001 10:34:19 PM] Chapter 8 Standard Modules 8.126 SDBM_File Provides Perl programs with tied access to SDBM database files. See Perl's built-in tie function and the DB_File module. 8.125 Safe 8.127 Search::Dict [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] [Chapter 8] 8.126 SDBM_File http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/perl/perlnut/ch08_126.htm [2/7/2001 10:34:21 PM] [...]... sigtrap qw(handler handlername normal-signals stack-trace error-signals); 8.131.1 Signal Handler Options Used to specify which handler is to be installed and used for signals installed after the handler: die Installs handler that dies with a message indicating what signal was trapped handler handlername Installs your handler handlername stack-trace Default signal handler Outputs stack trace to STDERR and... [Chapter 8] 8.1 47 Text::Wrap Chapter 8 Standard Modules 8.1 47 Text::Wrap Wraps text into a paragraph Defines the $columns variable, which specifies the output line length Default is 76 Exported on request Provides the following function: q wrap 8.146 Text::Tabs 8.148 Thread [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl. .. used must be at least number signal Installs a handler for any argument that looks like a signal name untrapped Installs handlers only for subsequently listed signals not already trapped or ignored 8.130 Shell 8.132 Socket [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_131.htm... http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_1 27. htm [2 /7/ 2001 10:34:22 PM] [Chapter 8] 8.128 SelectSaver Chapter 8 Standard Modules 8.128 SelectSaver Provides a way to save and restore filehandles so you can temporarily use a different filehandle q new 8.1 27 Search::Dict 8.129 SelfLoader [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook... Thread::Queue 8.151 Thread::Signal [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_150.htm [2 /7/ 2001 10:34:50 PM] [Chapter 8] 8.151 Thread::Signal Chapter 8 Standard Modules 8.151 Thread::Signal Starts a special signal handler thread... Term::Cap 8.140 Term::ReadLine [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_139.htm [2 /7/ 2001 10:34: 37 PM] [Chapter 8] 8.140 Term::ReadLine Chapter 8 Standard Modules 8.140 Term::ReadLine Front-end to other ReadLine packages Currently... Test also provides an onfail hook that can trigger additional diagnostics for failures at the end of the test run To use onfail, pass it an array reference of hash references where each hash contains at least these fields: package, repetition, and result, as well as any expected value or diagnostic string See the Test manpage for details and examples 8.140 Term::ReadLine 8.142 Test::Harness [ Library... thread to reliably run signal handlers All signals are handed to this thread, which runs the associated $SIG{signal} handlers for them use Thread::Signal; $SIG{HUP} = handler; 8.150 Thread::Semaphore 8.152 Thread::Specific [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_151.htm... sigtrap Pragma to enable simple signal handling Provides two signal handlers that can be installed, or you can install your own handler; also provides options to specify which signals to trap Ignores requests to trap signals not used in your system's architecture use sigtrap; # initialize default signal handlers use sigtrap qw(die normal-signals); use sigtrap 'handler' => \handlername, 'normal-signals';... SelfLoader exports the AUTOLOAD subroutine to the package; this subroutine loads the subroutines after DATA when they are required 8.128 SelectSaver 8.130 Shell [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_129.htm [2 /7/ 2001 . CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX. 8.128 SelectSaver [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ] [Chapter 8] 8.1 27 Search::Dict http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly /perl/ perlnut/ch08_1 27. htm. temporarily use a different filehandle. new● 8.1 27 Search::Dict 8.129 SelfLoader [ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming

Ngày đăng: 12/08/2014, 21:21

TỪ KHÓA LIÊN QUAN