Perl/Functions
-
- 1. Perl functions by category
-
-
- 1.1. SCALAR와 스트링 관련 함수 (Functions for SCALARs or strings)
-
- 1.2. 정규표현식과 패턴 일치 (Regular expressions and pattern matching)
-
- 1.3. 수 관련 함수 (Numeric functions)
-
- 1.4. @배열 관련 함수 (Functions for real @ARRAYs)
-
- 1.5. 리스트 데이타 관련 함수 (Functions for list data)
-
- 1.6. %해쉬 변수 관련 함수 (Functions for real %HASHes)
-
- 1.7. 입력,출력 함수 (Input and output functions)
-
- 1.8. Functions for fixed length data or records
-
- 1.9. Functions for filehandles, files, or directories
-
- 1.10. Keywords related to control flow of your perl program
-
- 1.11. Keywords altering or affecting scoping of identifiers
-
- 1.12. Miscellaneous functions
-
- 1.13. Functions for processes and process groups
-
- 1.14. Keywords related to perl modules
-
- 1.15. Keywords related to classes and object-orientedness
-
- 1.16. Low-level socket functions
-
- 1.17. System V interprocess communication functions
-
- 1.18. Fetching user and group info
-
- 1.19. Fetching network info
-
- 1.20. Time-related functions
-
1. Perl functions by category
1.1. SCALAR와 스트링 관련 함수 (Functions for SCALARs or strings)
- chomp - 스트링의 뒤에 있는 레코드 구분자를 제거 (remove a trailing record separator from a string)
- chop - 스트링의 마지막 캐릭터를 제거 (remove the last character from a string)
- chr - 숫자가 나타내는 캐릭터를 획득 (get character this number represents)
- crypt - 패스워드 스타일의 단방향 암호화 (one-way passwd-style encryption)
- hex - 스트링을 16진수로 변환 (convert a string to a hexadecimal number)
- index - 스트링 속의 서브스트링을 검색 (find a substring within a string)
- lc - 스트링의 소문자 버전을 반환 (return lower-case version of a string)
- lcfirst - 스트링의 첫글자를 소문자로 변환한 스트링을 반환 (return a string with just the next letter in lower case)
- length - 스트링이 차지하는 바이트 수 반환 (return the number of bytes in a string)
- oct - 스트링을 8진수로 반환 (convert a string to an octal number)
- ord - 캐릭터의 코드값을 반환 (find a character's numeric representation)
- pack - 리스트를 바이너리 시퀀스로 변환 (convert a list into a binary representation)
- q/STRING/ - (singly quote a string)
- qq/STRING/ - (doubly quote a string)
- reverse - 스트링 또는 리스트를 뒤집음 (flip a string or a list)
- rindex - 우측에서 좌측으로 서브스트링 검색 (right-to-left substring search)
- sprintf - 포맷된 출력을 스트링으로 반환 (formatted print into a string )
- substr - 스트링의 특정 부분을 얻거나 변경 (get or alter a portion of a stirng)
- tr/// - 스트링의 문자 변환 (transliterate a string)
- uc - 스트링의 대문자 버전을 반환 (return upper-case version of a string)
- ucfirst - 스트링의 첫글자를 대문자로 변환한 스트링을 반환 (return a string with just the next letter in upper case)
- y/// - 스트링의 문자 변환 (transliterate a string)
1.2. 정규표현식과 패턴 일치 (Regular expressions and pattern matching)
- m// - 정규표현식 패턴의 일치 검사 (match a string with a regular expression pattern)
- pos - 마지막 m//g 검색을 한 오프셋을 얻거나, 다음 검색을 위한 오프셋 지정 (find or set the offset for the last/next m//g search)
- qr/STRING/ - 패턴 컴파일 (Compile pattern)
- quotemeta - 정규표현식의 매직캐릭터들을 이스케이프시킴 (quote regular expression magic characters)
- s/// - 스트링에서 일치하는 패턴을 치환 (replace a pattern with a string)
- split - 정규표현식으로 된 구분자를 사용하여 스트링 분할 (split up a string using a regexp delimiter)
- study - 반복되는 검색을 위하여 입력 데이타 최적화 (optimize input data for repeated searches)
1.3. 수 관련 함수 (Numeric functions)
- abs - 절대값 (absolute value function)
- atan2 - 아크탄젠트 (arctangent of Y/X in the range -PI to PI)
- cos - 코사인 (cosine function)
- exp - 거듭제곱 (raise I to a power)
- hex - 스트링을 16진수로 변환 (convert a string to a hexadecimal number)
- int - 정수부 반환 (get the integer portion of a number)
- log - 자연로그 (retrieve the natural logarithm for a number)
- oct - 스트링을 8진수로 변환 (convert a string to an octal number)
- rand - 랜덤넘버 생성 (retrieve the next pseudorandom number )
- sin - 사인 (return the sine of a number)
- sqrt - 제곱근 (square root function)
- srand - 랜덤 넘버 생성기의 시드 설정 (seed the random number generator)
1.4. @배열 관련 함수 (Functions for real @ARRAYs)
- pop - 배열에서 마지막 원소를 제거하며 그 원소를 반환 (remove the last element from an array and return it)
- push - 하나 이상의 원소를 배열의 제일 뒤에 추가 (append one or more elements to an array)
- shift - 배열의 첫번째 원소를 제거하며 그 원소를 반환 (remove the first element of an array, and return it)
- splice - 배열의 원하는 위치에 원소를 추가 또는 삭제 (add or remove elements anywhere in an array)
- unshift - 하나 이상의 원소를 배열의 제일 앞에 추가 (prepend more elements to the beginning of a list)
1.5. 리스트 데이타 관련 함수 (Functions for list data)
- grep - 리스트에서 조건에 맞는 원소들을 찾아냄 (locate elements in a list test true against a given criterion)
- join - 리스트의 원소들을 합쳐서 스트링으로 변환 (join a list into a string using a separator)
- map - 리스트에 변경을 가하여 새로운 리스트를 만듦 (apply a change to a list to get back a new list with the changes)
- qw/STRING/ - 단어들의 리스트를 쿼우팅 (quote a list of words)
- reverse - 스트링이나 리스트를 뒤집음 (flip a string or a list)
- sort - 값들의 리스트를 정렬 (sort a list of values )
- unpack - 바이너리 구조체를 일반적인 펄 변수들의 리스트로 변환 (convert binary structure into normal perl variables)
1.6. %해쉬 변수 관련 함수 (Functions for real %HASHes)
- delete - 해쉬에서 값을 삭제 (deletes a value from a hash)
- each - 해쉬에서 다음 키/값 쌍을 가져옴 (retrieve the next key/value pair from a hash)
- exists - 해쉬에 특정한 키가 존재하는지 검사 (test whether a hash key is present)
- keys - 해쉬에서 키들의 리스트를 반환 (retrieve list of indices from a hash)
- values - 해쉬에서 값들의 리스트를 반환 (return a list of the values in a hash)
1.7. 입력,출력 함수 (Input and output functions)
- binmode - 바이너리 파일 입출력 준비 (prepare binary files for I/O)
- close - 파일 핸들 닫음 (close file (or pipe or socket) handle)
- closedir - 디렉토리 핸들 닫음 (close directory handle)
- dbmclose - tie되어 있는 dbm 파일에 대한 바인딩 해제 (breaks binding on a tied dbm file)
- dbmopen - tie되어 있는 dbm 파일에 대한 바인딩 생성 (create binding on a tied dbm file)
- die - 예외를 발생하고 종료 (raise an exception or bail out)
- eof - 파일 핸들을 확인해서 파일의 끝인지 검사 (test a filehandle for its end)
- fileno - 파일핸들로부터 파일 디스크립터 반환 (return file descriptor from filehandle)
- flock - 전체 파일에 협력적 락을 건다 (lock an entire file with an advisory lock)
- format - write()함수가 사용할 포맷을 선언 (declare a picture format with use by the write() function)
- getc - 파일핸들로부터 다음 캐릭터를 얻음 (get the next character from the filehandle)
- print - 리스트를 파일 핸들로 출력 (output a list to a filehandle)
- printf - 리스트를 포맷에 맞추어 파일 핸들로 출력 (output a formatted list to a filehandle)
- read - 파일 핸들로부터 고정 길이의 입력을 버퍼를 사용하여 받음 (fixed-length buffered input from a filehandle)
- readdir - 디렉토리 핸들로부터 디렉토리 내용을 얻음 (get a directory from a directory handle)
- readline - 파일에서 레코드를 가져옴 (fetch a record from a file)
- rewinddir - 디렉토리 핸들 리셋 (reset directory handle)
- seek - 랜덤 액세스 입출력시에 파일 포인터의 위치를 재설정 (reposition file pointer for random-access I/O)
- seekdir - 디렉토리 포인터 위치를 재설정 (reposition directory pointer )
- select - 출력을 리셋하거나 입출력 멀티플렉싱을 함 (reset default output or do I/O multiplexing)
- syscall - 임의의 시스템 호출 실행 (execute an arbitrary system call)
- sysread - 파일 핸들로부터 고정 길이의 입력을 버프를 쓰지 않고 받음 (fixed-length unbuffered input from a filehandle)
- sysseek - sysread와 syswrite에 사용되는 입출력 포인터의 위치를 재설정 (position I/O pointer on handle used with sysread and syswrite)
- syswrite - 파일 핸들을 통해 고정 길이 출력을 버퍼를 쓰지 않고 수행 (fixed-length unbuffered output to a filehandle)
- tell - 파일 핸들의 현재 포인터의 위치를 얻음 (get current seekpointer on a filehandle)
- telldir - 디렉토리 핸들의 현재 포인터의 위치를 얻음 (get current seekpointer on a directory handle)
- truncate - 파일을 잘라내어 크기를 줄임 (shorten a file)
- warn - 디버깅 정보 출력 (print debugging info)
- write - 레코드를 포맷에 맞게 출력 (print a picture record)
1.8. Functions for fixed length data or records
- pack - (convert a list into a binary representation)
- read - (fixed-length buffered input from a filehandle)
- syscall - (execute an arbitrary system call)
- sysread - (fixed-length unbuffered input from a filehandle)
- sysseek - (position I/O pointer on handle used with sysread and syswrite)
- syswrite - (fixed-length unbuffered output to a filehandle)
- unpack - (convert binary structure into normal perl variables)
- vec - (test or set particular bits in a string)
1.9. Functions for filehandles, files, or directories
- -X - (a file test (-r, -x, etc))
- chdir - (change your current working directory)
- chmod - (changes the permissions on a list of files)
- chown - (change the owership on a list of files)
- chroot - (make directory new root for path lookups)
- fcntl - (file control system call)
- glob - (expand filenames using wildcards)
- ioctl - (system-dependent device control system call)
- link - (create a hard link in the filesytem)
- lstat - (stat a symbolic link)
- mkdir - (create a directory)
- open - (open a file, pipe, or descriptor)
- opendir - (open a directory)
- readlink - (determine where a symbolic link is pointing)
- rename - (change a filename)
- rmdir - (remove a directory)
- stat - (get a file's status information)
- symlink - (create a symbolic link to a file)
- sysopen - (open a file, pipe, or descriptor)
- umask - (set file creation mode mask)
- unlink - (remove one link to a file)
- utime - (set a file's last access and modify times)
1.10. Keywords related to control flow of your perl program
- caller - (get context of the current subroutine call)
- continue - (optional trailing block in a while or foreach )
- die - (raise an exception or bail out)
- do - (turn a BLOCK into a TERM)
- dump - (create an immediate core dump)
- eval - (catch exceptions or compile and run code)
- exit - (terminate this program)
- goto - (create spaghetti code)
- last - (exit a block prematurely)
- next - (iterate a block prematurely)
- prototype - (get the prototype (if any) of a subroutine)
- redo - (start this loop iteration over again)
- return - (get out of a function early)
- sub - (declare a subroutine, possibly anonymously)
- wantarray - (get void vs scalar vs list context of current subroutine call)
1.11. Keywords altering or affecting scoping of identifiers
- caller - (get context of the current subroutine call)
- import - (patch a module's namespace into your own)
- local - (create a temporary value for a global variable (dynamic scoping))
- my - (declare and assign a local variable (lexical scoping))
- our - (declare and assign a package variable (lexical scoping))
- package - (declare a separate global namespace)
- use - (load in a module at compile time)
1.12. Miscellaneous functions
- defined - (test whether a value, variable, or function is defined)
- dump - (create an immediate core dump)
- eval - (catch exceptions or compile and run code)
- formline - (internal function used for formats)
- local - (create a temporary value for a global variable (dynamic scoping))
- my - (declare and assign a local variable (lexical scoping))
- our - (declare and assign a package variable (lexical scoping))
- prototype - (get the prototype (if any) of a subroutine)
- reset - (clear all variables of a given name)
- scalar - (force a scalar context)
- undef - (remove a variable or function definition)
- wantarray - (get void vs scalar vs list context of current subroutine call)
1.13. Functions for processes and process groups
- alarm - (schedule a SIGALRM )
- exec - (abandon this program to run another)
- fork - (create a new process just like this one)
- getpgrp - (get process group)
- getppid - (get parent process ID)
- getpriority - (get current nice value)
- kill - (send a signal to a process or process group)
- pipe - (open a pair of connected filehandles)
- qx/STRING/ - (backquote quote a string)
- readpipe - (execute a system command and collect standard output)
- setpgrp - (set the process group of a process)
- setpriority - (set a process's nice value)
- sleep - (block for some number of seconds)
- system - (run a separate program )
- times - (return elapsed time for self and child processes)
- wait - (wait for any child process to die)
- waitpid - (wait for a particular child process to die)
1.14. Keywords related to perl modules
- do - (turn a BLOCK into a TERM)
- import - (patch a module's namespace into your own)
- no - (unimport some module symbols or semantics at compile time)
- package - (declare a separate global namespace)
- require - (load in external functions from a library at runtime)
- use - (load in a module at compile time)
1.15. Keywords related to classes and object-orientedness
- bless - (create an object )
- dbmclose - (breaks binding on a tied dbm file)
- dbmopen - (create binding on a tied dbm file)
- package - (declare a separate global namespace)
- ref - (find out the type of thing being referenced)
- tie - (bind a variable to an object class )
- tied - (get a reference to the object underlying a tied variable)
- untie - (break a tie binding to a variable)
- use - (load in a module at compile time)
1.16. Low-level socket functions
- accept - (accept an incoming socket connect)
- bind - (binds an address to a socket)
- connect - (connect to a remote socket)
- getpeername - (find the other end of a socket connection)
- getsockname - (retrieve the sockaddr for a given socket)
- getsockopt - (get socket options on a given socket)
- listen - (register your socket as a server )
- recv - (receive a message over a Socket)
- send - (send a message over a socket)
- setsockopt - (set some socket options)
- shutdown - (close down just half of a socket connection)
- socket - (create a socket)
- socketpair - (create a pair of sockets)
1.17. System V interprocess communication functions
- msgctl - (SysV IPC message control operations)
- msgget - (get SysV IPC message queue)
- msgrcv - (receive a SysV IPC message from a message queue)
- msgsnd - (send a SysV IPC message to a message queue)
- semctl - (SysV semaphore control operations)
- semget - (get set of SysV semaphores)
- semop - (SysV semaphore operations)
- shmctl - (SysV shared memory operations)
- shmget - (get SysV shared memory segment identifier)
- shmread - (read SysV shared memory )
- shmwrite - (write SysV shared memory )
1.18. Fetching user and group info
- endgrent - (be done using group file)
- endhostent - (be done using hosts file)
- endnetent - (be done using networks file)
- endpwent - (be done using passwd file)
- getgrent - (get next group record )
- getgrgid - (get group record given group user ID)
- getgrnam - (get group record given group name)
- getlogin - (return who logged in at this tty)
- getpwent - (get next passwd record)
- getpwnam - (get passwd record given user login name)
- getpwuid - (get passwd record given user ID)
- setgrent - (prepare group file for use)
- setpwent - (prepare passwd file for use)
1.19. Fetching network info
1.20. Time-related functions
- gmtime - (convert UNIX time into record or string using Greenwich time)
- localtime - (convert UNIX time into record or string using local time)
- time - (return number of seconds since 1970)
- times - (return elapsed time for self and child processes)
컴퓨터분류