Commit | Line | Data |
d93fce09 |
1 | package Pod::Functions; |
cb1a09d0 |
2 | |
3 | #:vi:set ts=20 |
4 | |
b75c8c73 |
5 | our $VERSION = '1.00'; |
6 | |
cb1a09d0 |
7 | require Exporter; |
8 | |
9 | @ISA = qw(Exporter); |
40da2db3 |
10 | @EXPORT = qw(%Kinds %Type %Flavor %Type_Description @Type_Order); |
cb1a09d0 |
11 | |
b75c8c73 |
12 | our(%Kinds, %Type, %Flavor); |
13 | |
14 | our %Type_Description = ( |
cb1a09d0 |
15 | 'ARRAY' => 'Functions for real @ARRAYs', |
16 | 'Binary' => 'Functions for fixed length data or records', |
17 | 'File' => 'Functions for filehandles, files, or directories', |
18 | 'Flow' => 'Keywords related to control flow of your perl program', |
19 | 'HASH' => 'Functions for real %HASHes', |
20 | 'I/O' => 'Input and output functions', |
21 | 'LIST' => 'Functions for list data', |
22 | 'Math' => 'Numeric functions', |
23 | 'Misc' => 'Miscellaneous functions', |
24 | 'Modules' => 'Keywords related to perl modules', |
25 | 'Network' => 'Fetching network info', |
26 | 'Objects' => 'Keywords related to classes and object-orientedness', |
27 | 'Process' => 'Functions for processes and process groups', |
28 | 'Regexp' => 'Regular expressions and pattern matching', |
29 | 'Socket' => 'Low-level socket functions', |
30 | 'String' => 'Functions for SCALARs or strings', |
31 | 'SysV' => 'System V interprocess communication functions', |
32 | 'Time' => 'Time-related functions', |
33 | 'User' => 'Fetching user and group info', |
34 | 'Namespace' => 'Keywords altering or affecting scoping of identifiers', |
35 | ); |
36 | |
b75c8c73 |
37 | our @Type_Order = qw{ |
cb1a09d0 |
38 | String |
39 | Regexp |
40 | Math |
41 | ARRAY |
42 | LIST |
43 | HASH |
44 | I/O |
45 | Binary |
46 | File |
47 | Flow |
48 | Namespace |
49 | Misc |
50 | Process |
51 | Modules |
52 | Objects |
53 | Socket |
54 | SysV |
55 | User |
56 | Network |
57 | Time |
58 | }; |
59 | |
60 | while (<DATA>) { |
61 | chomp; |
62 | s/#.*//; |
63 | next unless $_; |
b75c8c73 |
64 | my($name, $type, $text) = split " ", $_, 3; |
cb1a09d0 |
65 | $Type{$name} = $type; |
66 | $Flavor{$name} = $text; |
b75c8c73 |
67 | for my $t ( split /[,\s]+/, $type ) { |
68 | push @{$Kinds{$t}}, $name; |
cb1a09d0 |
69 | } |
70 | } |
71 | |
3e92a254 |
72 | close DATA; |
73 | |
cb1a09d0 |
74 | unless (caller) { |
b75c8c73 |
75 | foreach my $type ( @Type_Order ) { |
76 | my $list = join(", ", sort @{$Kinds{$type}}); |
77 | my $typedesc = $Type_Description{$type} . ":"; |
cb1a09d0 |
78 | write; |
79 | } |
80 | } |
81 | |
82 | format = |
83 | |
84 | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
85 | $typedesc |
86 | ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
87 | $typedesc |
88 | ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
89 | $list |
90 | . |
91 | |
92 | 1 |
93 | |
94 | __DATA__ |
95 | -X File a file test (-r, -x, etc) |
96 | abs Math absolute value function |
97 | accept Socket accept an incoming socket connect |
98 | alarm Process schedule a SIGALRM |
19799a22 |
99 | atan2 Math arctangent of Y/X in the range -PI to PI |
cb1a09d0 |
100 | bind Socket binds an address to a socket |
19799a22 |
101 | binmode I/O prepare binary files for I/O |
cb1a09d0 |
102 | bless Objects create an object |
103 | caller Flow,Namespace get context of the current subroutine call |
104 | chdir File change your current working directory |
105 | chmod File changes the permissions on a list of files |
106 | chomp String remove a trailing record separator from a string |
107 | chop String remove the last character from a string |
108 | chown File change the owership on a list of files |
109 | chr String get character this number represents |
110 | chroot File make directory new root for path lookups |
111 | close I/O close file (or pipe or socket) handle |
112 | closedir I/O close directory handle |
19799a22 |
113 | connect Socket connect to a remote socket |
cb1a09d0 |
114 | continue Flow optional trailing block in a while or foreach |
115 | cos Math cosine function |
116 | crypt String one-way passwd-style encryption |
117 | dbmclose Objects,I/O breaks binding on a tied dbm file |
118 | dbmopen Objects,I/O create binding on a tied dbm file |
119 | defined Misc test whether a value, variable, or function is defined |
120 | delete HASH deletes a value from a hash |
121 | die I/O,Flow raise an exception or bail out |
122 | do Flow,Modules turn a BLOCK into a TERM |
123 | dump Misc,Flow create an immediate core dump |
124 | each HASH retrieve the next key/value pair from a hash |
125 | endgrent User be done using group file |
126 | endhostent User be done using hosts file |
127 | endnetent User be done using networks file |
128 | endprotoent Network be done using protocols file |
129 | endpwent User be done using passwd file |
130 | endservent Network be done using services file |
131 | eof I/O test a filehandle for its end |
19799a22 |
132 | eval Flow,Misc catch exceptions or compile and run code |
cb1a09d0 |
133 | exec Process abandon this program to run another |
134 | exists HASH test whether a hash key is present |
135 | exit Flow terminate this program |
136 | exp Math raise I<e> to a power |
19799a22 |
137 | fcntl File file control system call |
cb1a09d0 |
138 | fileno I/O return file descriptor from filehandle |
139 | flock I/O lock an entire file with an advisory lock |
140 | fork Process create a new process just like this one |
141 | format I/O declare a picture format with use by the write() function |
142 | formline Misc internal function used for formats |
143 | getc I/O get the next character from the filehandle |
144 | getgrent User get next group record |
145 | getgrgid User get group record given group user ID |
146 | getgrnam User get group record given group name |
147 | gethostbyaddr Network get host record given its address |
148 | gethostbyname Network get host record given name |
149 | gethostent Network get next hosts record |
150 | getlogin User return who logged in at this tty |
151 | getnetbyaddr Network get network record given its address |
152 | getnetbyname Network get networks record given name |
153 | getnetent Network get next networks record |
19799a22 |
154 | getpeername Socket find the other end of a socket connection |
cb1a09d0 |
155 | getpgrp Process get process group |
156 | getppid Process get parent process ID |
157 | getpriority Process get current nice value |
158 | getprotobyname Network get protocol record given name |
159 | getprotobynumber Network get protocol record numeric protocol |
160 | getprotoent Network get next protocols record |
161 | getpwent User get next passwd record |
162 | getpwnam User get passwd record given user login name |
163 | getpwuid User get passwd record given user ID |
164 | getservbyname Network get services record given its name |
165 | getservbyport Network get services record given numeric port |
166 | getservent Network get next services record |
167 | getsockname Socket retrieve the sockaddr for a given socket |
168 | getsockopt Socket get socket options on a given socket |
169 | glob File expand filenames using wildcards |
170 | gmtime Time convert UNIX time into record or string using Greenwich time |
171 | goto Flow create spaghetti code |
172 | grep LIST locate elements in a list test true against a given criterion |
173 | hex Math,String convert a string to a hexadecimal number |
174 | import Modules,Namespace patch a module's namespace into your own |
175 | index String find a substring within a string |
176 | int Math get the integer portion of a number |
177 | ioctl File system-dependent device control system call |
178 | join LIST join a list into a string using a separator |
179 | keys HASH retrieve list of indices from a hash |
180 | kill Process send a signal to a process or process group |
181 | last Flow exit a block prematurely |
182 | lc String return lower-case version of a string |
183 | lcfirst String return a string with just the next letter in lower case |
184 | length String return the number of bytes in a string |
185 | link File create a hard link in the filesytem |
186 | listen Socket register your socket as a server |
187 | local Misc,Namespace create a temporary value for a global variable (dynamic scoping) |
188 | localtime Time convert UNIX time into record or string using local time |
19799a22 |
189 | lock Threads get a thread lock on a variable, subroutine, or method |
cb1a09d0 |
190 | log Math retrieve the natural logarithm for a number |
191 | lstat File stat a symbolic link |
192 | m// Regexp match a string with a regular expression pattern |
193 | map LIST apply a change to a list to get back a new list with the changes |
194 | mkdir File create a directory |
195 | msgctl SysV SysV IPC message control operations |
196 | msgget SysV get SysV IPC message queue |
197 | msgrcv SysV receive a SysV IPC message from a message queue |
198 | msgsnd SysV send a SysV IPC message to a message queue |
199 | my Misc,Namespace declare and assign a local variable (lexical scoping) |
200 | next Flow iterate a block prematurely |
201 | no Modules unimport some module symbols or semantics at compile time |
202 | package Modules,Objects,Namespace declare a separate global namespace |
1b33caba |
203 | prototype Flow,Misc get the prototype (if any) of a subroutine |
cb1a09d0 |
204 | oct String,Math convert a string to an octal number |
205 | open File open a file, pipe, or descriptor |
206 | opendir File open a directory |
207 | ord String find a character's numeric representation |
208 | pack Binary,String convert a list into a binary representation |
209 | pipe Process open a pair of connected filehandles |
210 | pop ARRAY remove the last element from an array and return it |
211 | pos Regexp find or set the offset for the last/next m//g search |
212 | print I/O output a list to a filehandle |
213 | printf I/O output a formatted list to a filehandle |
214 | push ARRAY append one or more elements to an array |
215 | q/STRING/ String singly quote a string |
216 | qq/STRING/ String doubly quote a string |
217 | quotemeta Regexp quote regular expression magic characters |
218 | qw/STRING/ LIST quote a list of words |
219 | qx/STRING/ Process backquote quote a string |
393d87f4 |
220 | qr/PATTERN/ Regexp Compile pattern |
cb1a09d0 |
221 | rand Math retrieve the next pseudorandom number |
222 | read I/O,Binary fixed-length buffered input from a filehandle |
223 | readdir I/O get a directory from a directory handle |
393d87f4 |
224 | readline I/O fetch a record from a file |
cb1a09d0 |
225 | readlink File determine where a symbolic link is pointing |
226 | recv Socket receive a message over a Socket |
227 | redo Flow start this loop iteration over again |
228 | ref Objects find out the type of thing being referenced |
229 | rename File change a filename |
230 | require Modules load in external functions from a library at runtime |
231 | reset Misc clear all variables of a given name |
232 | return Flow get out of a function early |
233 | reverse String,LIST flip a string or a list |
234 | rewinddir I/O reset directory handle |
235 | rindex String right-to-left substring search |
236 | rmdir File remove a directory |
237 | s/// Regexp replace a pattern with a string |
238 | scalar Misc force a scalar context |
239 | seek I/O reposition file pointer for random-access I/O |
240 | seekdir I/O reposition directory pointer |
241 | select I/O reset default output or do I/O multiplexing |
242 | semctl SysV SysV semaphore control operations |
243 | semget SysV get set of SysV semaphores |
244 | semop SysV SysV semaphore operations |
245 | send Socket send a message over a socket |
246 | setgrent User prepare group file for use |
247 | sethostent Network prepare hosts file for use |
248 | setnetent Network prepare networks file for use |
249 | setpgrp Process set the process group of a process |
250 | setpriority Process set a process's nice value |
251 | setprotoent Network prepare protocols file for use |
252 | setpwent User prepare passwd file for use |
253 | setservent Network prepare services file for use |
254 | setsockopt Socket set some socket options |
255 | shift ARRAY remove the first element of an array, and return it |
256 | shmctl SysV SysV shared memory operations |
257 | shmget SysV get SysV shared memory segment identifier |
258 | shmread SysV read SysV shared memory |
259 | shmwrite SysV write SysV shared memory |
260 | shutdown Socket close down just half of a socket connection |
19799a22 |
261 | sin Math return the sine of a number |
cb1a09d0 |
262 | sleep Process block for some number of seconds |
263 | socket Socket create a socket |
264 | socketpair Socket create a pair of sockets |
265 | sort LIST sort a list of values |
266 | splice ARRAY add or remove elements anywhere in an array |
267 | split Regexp split up a string using a regexp delimiter |
268 | sprintf String formatted print into a string |
269 | sqrt Math square root function |
270 | srand Math seed the random number generator |
271 | stat File get a file's status information |
272 | study Regexp optimize input data for repeated searches |
273 | sub Flow declare a subroutine, possibly anonymously |
274 | substr String get or alter a portion of a stirng |
275 | symlink File create a symbolic link to a file |
276 | syscall I/O,Binary execute an arbitrary system call |
277 | sysread I/O,Binary fixed-length unbuffered input from a filehandle |
393d87f4 |
278 | sysseek I/O,Binary position I/O pointer on handle used with sysread and syswrite |
cb1a09d0 |
279 | system Process run a separate program |
280 | syswrite I/O,Binary fixed-length unbuffered output to a filehandle |
281 | tell I/O get current seekpointer on a filehandle |
282 | telldir I/O get current seekpointer on a directory handle |
283 | tie Objects bind a variable to an object class |
284 | time Time return number of seconds since 1970 |
285 | times Process,Time return elapsed time for self and child processes |
286 | tr/// String transliterate a string |
287 | truncate I/O shorten a file |
288 | uc String return upper-case version of a string |
289 | ucfirst String return a string with just the next letter in upper case |
290 | umask File set file creation mode mask |
291 | undef Misc remove a variable or function definition |
292 | unlink File remove one link to a file |
293 | unpack Binary,LIST convert binary structure into normal perl variables |
294 | unshift ARRAY prepend more elements to the beginning of a list |
295 | untie Objects break a tie binding to a variable |
296 | use Modules,Namespace load a module and import its namespace |
297 | use Objects load in a module at compile time |
298 | utime File set a file's last access and modify times |
299 | values HASH return a list of the values in a hash |
300 | vec Binary test or set particular bits in a string |
301 | wait Process wait for any child process to die |
302 | waitpid Process wait for a particular child process to die |
91e74348 |
303 | wantarray Misc,Flow get void vs scalar vs list context of current subroutine call |
cb1a09d0 |
304 | warn I/O print debugging info |
305 | write I/O print a picture record |
306 | y/// String transliterate a string |