home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / ObiWan 5.2 / Databases / Perl < prev    next >
Encoding:
Text File  |  1997-03-13  |  12.8 KB  |  393 lines  |  [TEXT/R*ch]

  1. =|
  2. A long time ago in a galaxy far far away… PERL [1/2]
  3. ObiWan is a general purpose popup help system. ObiWan ships with a
  4. database called the “Force” which describes the Macintosh operating
  5. system APIs. The ObiWan distribution also contains a number of other
  6. databases, such as a word list and help for the programming languages
  7. Perl, Java and HTML.  [press cmd-. to view next page]|
  8. A long time ago in a galaxy far far away… PERL [2/2]
  9. You can also build your own databases using the Master Yoda application.
  10. Double click any of the following words for more help on that topic:
  11.     Buttons, HotKeys, OtherDatabases,
  12.     Copyright, MasterYoda, MissedClicks
  13. [press cmd-` to show or hide this window]|
  14. accept(NEWSOCKET,GENERICSOCKET)|
  15. alarm(SECONDS)|
  16. answer(PROMPT,BUTTON1,BUTTON2,BUTTON3)|
  17. ask(PROMPT, DEFAULT)|
  18. atan2(Y,X)|
  19. bind(SOCKET,NAME)|
  20. binmode(FILEHANDLE)|
  21. Buttons at the top of the window are (from left to right):
  22.     Find Key, Search, Web Search, Previous Entry, Next Entry, Back
  23.     Type Word, Type Line, Type Procedure, Type Entry
  24.     Toggle Startup Sound, Toggle Invocation Sound [only on some versions]
  25.     About, Change Databases
  26. See HotKeys for a better description of these functions.|
  27. caller(EXPR)|
  28. chdir(EXPR)|
  29. chmod(LIST)|
  30. choose(DOMAIN,TYPE,PROMPT,CONSTRAINT,FLAGS,DEFAULT)|
  31. chop(LIST)|
  32. chown(LIST)|
  33. chroot(FILENAME)|
  34. close(FILEHANDLE)|
  35. closedir(DIRHANDLE)|
  36. connect(SOCKET,NAME)|
  37. Copyright 1992-97 Peter N Lewis and Stairways Software|
  38. cos(EXPR)|
  39. crypt(PLAINTEXT,SALT)|
  40. dbmclose(ASSOC_ARRAY)|
  41. dbmopen(ASSOC,DBNAME,MODE)|
  42. defined(EXPR)|
  43. delete $ASSOC{KEY}|
  44. die(LIST)|
  45. do BLOCK|
  46. dump LABEL|
  47. each(ASSOC_ARRAY)|
  48. eof(FILEHANDLE)|
  49. eval(EXPR)|
  50. exec(LIST)|
  51. exit(EXPR)|
  52. exp(EXPR)|
  53. fcntl(FILEHANDLE,FUNCTION,SCALAR)|
  54. fgetfileinfo(FILE)|
  55. fileno(FILEHANDLE)|
  56. flock(FILEHANDLE,OPERATION)|
  57. fork|
  58. fsetfileinfo(CREATOR,TYPE,FILE...)|
  59. getc(FILEHANDLE)|
  60. getlogin|
  61. getpeername(SOCKET)|
  62. getpgrp(PID)|
  63. getppid|
  64. getpriority(WHICH,WHO)|
  65. getsockname(SOCKET)|
  66. getsockopt(SOCKET,LEVEL,OPTNAME)|
  67. Globals [1/6]
  68. $_  default input and pattern-searching space
  69. $.  current line number of the last read filehandle
  70. $/  input record separator ("\n")
  71. $,  output field separator for the  print  operator ("")
  72. $"  array output separator for the  print  operator (" ")
  73. $\  output record terminator for the print operator ("")
  74. $#  output format for printed numbers ("%.20g")
  75. $%  current page number or the current output channel|
  76. Globals [2/6]
  77. $=  current page length (printable lines). (60)
  78. $-  number of lines left on the output page
  79. $~  name of the current output report format (filehandle)
  80. $^  name of the current top-of-page format (filehandle_TOP)
  81. $<bar> force a flush after every write/print if non zero (0)
  82. $$  process number (PID) of the perl running the script
  83. $?  status returned by the last pipe close, backtick or system
  84. $&  the entire string matched by the last  pattern  match|
  85. Globals [3/6]
  86. $`  everything before the matched substring
  87. $'  everything after the matched substring
  88. $+  the last bracketed substring
  89. $*  multiline matching withing a string? (0)
  90. $0  name of the file containing the perl script
  91. $N  the Nth bracketed substring
  92. $[  index of the first element in an array/string (0)
  93. $]  perl version|
  94. Globals [4/6]
  95. $;  subscript separator for multi-dimensional arrays (\034)
  96. $!  errno or error string
  97. $@  perl syntax error message from the last eval
  98. $<  real uid of this process
  99. $>  effective uid of this process
  100. $(  real gid(s) of this process
  101. $)  effective gid(s) of this process
  102. $:  chars where perl can split continuation fields (" \n-")|
  103. Globals [5/6]
  104. $^D debugging flags
  105. $^F maximum system file descriptor (2)
  106. $^I inplace-edit extension
  107. $^P internal debugging flag
  108. $^T time at which the script began running
  109. $^W warning switch
  110. $^X name that Perl was executed as (argv[0])|
  111. Globals [6/6]
  112. $ARGV the name of the current file when reading from <>
  113. @ARGV the array of command line arguments
  114. @INC  perl include directory list (-l, "/usr/local/lib/perl", ".")
  115. %INC  associative array of included files
  116. $ENV{expr}  environment variables
  117. $SIG{expr}  signal handlers|
  118. gmtime(EXPR)|
  119. goto LABEL|
  120. grep(EXPR,LIST)|
  121. Help Me ObiWan Kenobi, You’re My Only Hope!
  122. To get help about using ObiWan, close and reopen the window, then
  123. type “a” and hit return.|
  124. hex(EXPR)|
  125. HotKeys For ObiWan [1/4]
  126. You can open the ObiWan window with the following hot key:
  127.     command-`    Pops up ObiWan. This also closes the window if it’s
  128.                 already open.
  129. Typing any printable character will enter it into the current text.
  130. You can then perform other actions using other hot keys.
  131. The following hot keys are supported by ObiWan when its window is open:
  132.     return        Finds the keys for the current text.
  133.     shift-return    Searches the text of the database for the current text.|
  134. HotKeys For ObiWan [2/4]
  135.     option-shift-return    Web Search for the current text.
  136.     option-return    Selects a new database from the ObiWan Folder using
  137.                 the current text as the file name.
  138.                 If the current text is “C” then it selects the C procedure
  139.                 parser. If the current text is “Pascal” it returns to
  140.                 the default procedure parser. See below for more info on
  141.                 parsers.
  142.     command-enter    ‘Types’ the selection into the frontmost application.|
  143. HotKeys For ObiWan [3/4]
  144.                 You can achieve various other behaviours using more
  145.                 modifier keys:
  146.         command-option-enter        ‘Types’ the first line of the entry.
  147.         command-option-shift-enter    ‘Types’ the entire entry.
  148.         command-shift-enter        ‘Types’ the entry as a procedure call.
  149.                                 The language of the call is determined
  150.                                 by the current procedure parser.
  151.     command-.    Goes to the next entry.|
  152. HotKeys For ObiWan [4/4]
  153.     command-,    Goes to the previous entry.
  154.     command-]    Goes to the selected word’s entry.
  155.     command-[    Returns to the most recent entry.
  156. In additon, other functions are accessible using the mouse:
  157.     click            Selects the word.
  158.     command-click    Selects the word and ‘types’ it.
  159.     double-click    Selects the word and finds it.|
  160. index(STR,SUBSTR,POSITION)|
  161. int(EXPR)|
  162. ioctl(FILEHANDLE,FUNCTION,SCALAR)|
  163. join(EXPR,LIST)|
  164. keys(ASSOC_ARRAY)|
  165. kill(LIST)|
  166. last LABEL|
  167. length(EXPR)|
  168. link(OLDFILE,NEWFILE)|
  169. listen(SOCKET,QUEUESIZE)|
  170. local(LIST)|
  171. localtime(EXPR)|
  172. log(EXPR)|
  173. lstat(FILEHANDLE)|
  174. m/PATTERN/gio|
  175. MasterYoda Database Processing Application
  176. You can use the Master Yoda application to build your own ObiWan databases.
  177. The application processes database files and prepares them for use with
  178. ObiWan. Database files are simple text files; you can get help on the file
  179. format from Master Yoda. Master Yoda also allows you to sort databases,
  180. merge, sorted databases, generate statistics on a database and select what
  181. characters constitute a word within a given database.|
  182. MissedClicks
  183. Yes, I know that ObiWan sometimes doesn’t respond to clicks. It’s not my
  184. fault! The clicks are disappearing somewhere in the system software; they
  185. never make it through to ObiWan. You can fix this problem by installing
  186. Matt Slot’s TSM Fix extension.|
  187. mkdir(FILENAME,MODE)|
  188. msgctl(ID,CMD,ARG)|
  189. msgget(KEY,FLAGS)|
  190. msgrcv(ID,VAR,SIZE,TYPE,FLAGS)|
  191. msgsnd(ID,MSG,FLAGS)|
  192. next LABEL|
  193. oct(EXPR)|
  194. open(FILEHANDLE,EXPR) [1/2]
  195. returns non zero on success (PID of subprocess for pipes)
  196. open(F,"file")    input
  197. open(F,"<file")   input (+< read/write)
  198. open(F,">file")   output (+> read/write)
  199. open(F,">>file")  append (+>> read/write)
  200. open(F,"<PIPE>prog")   piped output
  201. open(F,"prog<PIPE>")   piped input|
  202. open(FILEHANDLE,EXPR) [2/2]
  203. open(F,"-")       STDIN
  204. open(F,">-")      STDOUT
  205. open(F,">&FILE")  dup FILE and open (>>&, <&, +>&, +>>&, +<&)
  206. open(F,"<PIPE>-") implicit fork, returns pid to parent, 0 to child
  207. open(F,"file")    input
  208. open(F,"file")    input
  209. open(F,"file")    input|
  210. opendir(DIRHANDLE,EXPR)|
  211. ord(EXPR)|
  212. OtherDatabases
  213. Other databases that ship with ObiWan include:
  214.     Words    A list of words from Rogets Thesaurus;
  215.             great for checking your spelling quickly.
  216.     Perl        Reference material for the Perl programming languange.
  217.     HTML    Reference material for the HTML markup language.
  218.     Java        Reference material for the Java programming languange.
  219.     Force    Reference material for the Mac OS APIs.|
  220. pack(TEMPLATE,LIST) [1/4]
  221. xN   repeat x N times
  222. x*   repeat x as many times as necessary
  223. pack("c2x2c2",65,66,67,68) gives "AB\0\0CD"
  224. pack("a4","abcd","x","y","z") gives "abcd"
  225. pack("aaaa","abcd","x","y","z") gives "axyz"
  226. pack("a14","abcdefg") gives "abcdefg\0\0\0\0\0\0\0"|
  227. pack(TEMPLATE,LIST) [2/4]
  228. A    An ascii string, will be space padded.
  229. a    An ascii string, will be null padded.
  230. c    A signed char value.
  231. C    An unsigned char value.
  232. s    A signed short value.
  233. S    An unsigned short value.
  234. i    A signed integer value.
  235. I    An unsigned integer value.
  236. l    A signed long value.
  237. L    An unsigned long value.|
  238. pack(TEMPLATE,LIST) [3/4]
  239. n    A short in "network" order.
  240. N    A long in "network" order.
  241. f    A single-precision float in the native format.
  242. d    A double-precision float in the native format.
  243. p    A pointer to a string.
  244. v    A short in "VAX" (little-endian) order.
  245. V    A long in "VAX" (little-endian) order.
  246. x    A null byte.
  247. X    Back up a byte.|
  248. pack(TEMPLATE,LIST) [4/4]
  249. @    Null fill to absolute position.
  250. u    A uuencoded string.
  251. b    A bit string (ascending bit order, like vec()).
  252. B    A bit string (descending bit order).
  253. h    A hex string (low nybble first).
  254. H    A hex string (high nybble first).|
  255. pick(PROMPT, VALUES)|
  256. pipe(READHANDLE,WRITEHANDLE)|
  257. pop(ARRAY)|
  258. Predefined Names see Globals|
  259. print(FILEHANDLE LIST)|
  260. printf(FILEHANDLE LIST)|
  261. push(ARRAY,LIST)|
  262. q/STRING/|
  263. rand(EXPR)|
  264. read(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
  265. readdir(DIRHANDLE)|
  266. readlink(EXPR)|
  267. recv(SOCKET,SCALAR,LEN,FLAGS)|
  268. redo LABEL|
  269. Regular Expressions [1/3]
  270. \w (\W) matches (non)alphanumeric (including _)
  271. \b (\B) matches (non)word boundaries
  272. \b      matches backspace in a character class
  273. \s (\S) matches (non)whitespace
  274. \d (\D) matches (non)numeric
  275. \n, \r  newline, carriage return
  276. \f, \t  formfeed, tab
  277. \NNN    octal character|
  278. Regular Expressions [2/3]
  279. \N  the Nth bracketed substring
  280. $N  as above, use $N outside patterns
  281. $+  the last bracketed substring
  282. $`  everything before the matched substring
  283. $&  the entire matched substring
  284. $'  everything after the matched substring|
  285. Regular Expressions [3/3]
  286. <bar> alternatives /hello<bar>goodbye/
  287. ^     start of string (or after newline if $* is 1)
  288. $     end of string (or before newline if $* is 1)
  289. .     any character except newline
  290. {n,m} match preceeding regexp between n and m times
  291. {n}   match n times, equivalent to {n,n}
  292. {n,}  match n or more times, equivalent to {n,infinity}
  293. *     zero or more times, equivalent to {0,}
  294. +     one or more times, equivalent to {1,}
  295. ?     zero or one times, equivalent to {0,1}|
  296. rename(OLDNAME,NEWNAME)|
  297. require(EXPR)|
  298. reset(EXPR)|
  299. return LIST|
  300. reverse(LIST)|
  301. rewinddir(DIRHANDLE)|
  302. rindex(STR,SUBSTR,POSITION)|
  303. rmdir(FILENAME)|prog")|
  304. s/PATTERN/REPLACEMENT/gieo|
  305. scalar(EXPR)|
  306. seek(FILEHANDLE,POSITION,WHENCE)|
  307. seekdir(DIRHANDLE,POS)|
  308. select(FILEHANDLE)|
  309. semctl(ID,SEMNUM,CMD,ARG)|
  310. semget(KEY,NSEMS,SIZE,FLAGS)|
  311. semop(KEY,OPSTRING)|
  312. send(SOCKET,MSG,FLAGS,TO)|
  313. setpgrp(PID,PGRP)|
  314. setpriority(WHICH,WHO,PRIORITY)|
  315. setsockopt(SOCKET,LEVEL,OPTNAME,OPTVAL)|
  316. shift(ARRAY)|
  317. shmctl(ID,CMD,ARG)|
  318. shmget(KEY,SIZE,FLAGS)|
  319. shmread(ID,VAR,POS,SIZE)|
  320. shutdown(SOCKET,HOW)|
  321. sin(EXPR)|
  322. sleep(EXPR)|
  323. socket(SOCKET,DOMAIN,TYPE,PROTOCOL)|
  324. socketpair(SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL)|
  325. sort(SUBROUTINE LIST)|
  326. splice(ARRAY,OFFSET,LENGTH,LIST)|
  327. split(/PATTERN/,EXPR,LIMIT)|
  328. sprintf(FORMAT,LIST)|
  329. sqrt(EXPR)|
  330. srand(EXPR)|
  331. stat(FILEHANDLE) [1/4]
  332. ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  333. $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
  334. _    special filehandle of the last stat'ed file
  335. -e   File exists.
  336. -z   File has zero size.
  337. -s   File has non-zero size (returns size).|
  338. stat(FILEHANDLE) [2/4]
  339. -r   File is readable by effective uid.
  340. -w   File is writable by effective uid.
  341. -x   File is executable by effective uid.
  342. -o   File is owned by effective uid.
  343. -R   File is readable by real uid.
  344. -W   File is writable by real uid.
  345. -X   File is executable by real uid.
  346. -O   File is owned by real uid.|
  347. stat(FILEHANDLE) [3/4]
  348. -f   File is a plain file.
  349. -d   File is a directory.
  350. -l   File is a symbolic link.
  351. -p   File is a named pipe (FIFO).
  352. -S   File is a socket.
  353. -b   File is a block special file.
  354. -c   File is a character special file.|
  355. stat(FILEHANDLE) [4/4]
  356. -u   File has setuid bit set.
  357. -g   File has setgid bit set.
  358. -k   File has sticky bit set.
  359. -t   Filehandle is opened to a tty.
  360. -T   File is a text file.
  361. -B   File is a binary file (opposite of -T).
  362. -M   Age of file in days when script started.
  363. -A   Same for access time.
  364. -C   Same for inode change time.|
  365. study(SCALAR)|
  366. substr(EXPR,OFFSET,LEN)|
  367. symlink(OLDFILE,NEWFILE)|
  368. syscall(LIST)|
  369. sysread(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
  370. system(LIST)|
  371. syswrite(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
  372. tell(FILEHANDLE)|
  373. telldir(DIRHANDLE)|
  374. time|
  375. times|
  376. tr/SEARCHLIST/REPLACEMENTLIST/cds|
  377. truncate(FILEHANDLE,LENGTH)|
  378. umask(EXPR)|
  379. undef(EXPR)|
  380. unlink(LIST)|
  381. unpack(TEMPLATE,EXPR)
  382. see also pack for a list of template characters|
  383. unshift(ARRAY,LIST)|
  384. utime(LIST)|
  385. values(ASSOC_ARRAY)|
  386. vec(EXPR,OFFSET,BITS)|
  387. wait|
  388. waitpid(PID,FLAGS)|
  389. wantarray|
  390. warn(LIST)|
  391. write(FILEHANDLE)|
  392. =|
  393.