home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-03-13 | 12.8 KB | 393 lines | [TEXT/R*ch] |
- =|
- A long time ago in a galaxy far far away… PERL [1/2]
- ObiWan is a general purpose popup help system. ObiWan ships with a
- database called the “Force” which describes the Macintosh operating
- system APIs. The ObiWan distribution also contains a number of other
- databases, such as a word list and help for the programming languages
- Perl, Java and HTML. [press cmd-. to view next page]|
- A long time ago in a galaxy far far away… PERL [2/2]
- You can also build your own databases using the Master Yoda application.
- Double click any of the following words for more help on that topic:
- Buttons, HotKeys, OtherDatabases,
- Copyright, MasterYoda, MissedClicks
- [press cmd-` to show or hide this window]|
- accept(NEWSOCKET,GENERICSOCKET)|
- alarm(SECONDS)|
- answer(PROMPT,BUTTON1,BUTTON2,BUTTON3)|
- ask(PROMPT, DEFAULT)|
- atan2(Y,X)|
- bind(SOCKET,NAME)|
- binmode(FILEHANDLE)|
- Buttons at the top of the window are (from left to right):
- Find Key, Search, Web Search, Previous Entry, Next Entry, Back
- Type Word, Type Line, Type Procedure, Type Entry
- Toggle Startup Sound, Toggle Invocation Sound [only on some versions]
- About, Change Databases
- See HotKeys for a better description of these functions.|
- caller(EXPR)|
- chdir(EXPR)|
- chmod(LIST)|
- choose(DOMAIN,TYPE,PROMPT,CONSTRAINT,FLAGS,DEFAULT)|
- chop(LIST)|
- chown(LIST)|
- chroot(FILENAME)|
- close(FILEHANDLE)|
- closedir(DIRHANDLE)|
- connect(SOCKET,NAME)|
- Copyright 1992-97 Peter N Lewis and Stairways Software|
- cos(EXPR)|
- crypt(PLAINTEXT,SALT)|
- dbmclose(ASSOC_ARRAY)|
- dbmopen(ASSOC,DBNAME,MODE)|
- defined(EXPR)|
- delete $ASSOC{KEY}|
- die(LIST)|
- do BLOCK|
- dump LABEL|
- each(ASSOC_ARRAY)|
- eof(FILEHANDLE)|
- eval(EXPR)|
- exec(LIST)|
- exit(EXPR)|
- exp(EXPR)|
- fcntl(FILEHANDLE,FUNCTION,SCALAR)|
- fgetfileinfo(FILE)|
- fileno(FILEHANDLE)|
- flock(FILEHANDLE,OPERATION)|
- fork|
- fsetfileinfo(CREATOR,TYPE,FILE...)|
- getc(FILEHANDLE)|
- getlogin|
- getpeername(SOCKET)|
- getpgrp(PID)|
- getppid|
- getpriority(WHICH,WHO)|
- getsockname(SOCKET)|
- getsockopt(SOCKET,LEVEL,OPTNAME)|
- Globals [1/6]
- $_ default input and pattern-searching space
- $. current line number of the last read filehandle
- $/ input record separator ("\n")
- $, output field separator for the print operator ("")
- $" array output separator for the print operator (" ")
- $\ output record terminator for the print operator ("")
- $# output format for printed numbers ("%.20g")
- $% current page number or the current output channel|
- Globals [2/6]
- $= current page length (printable lines). (60)
- $- number of lines left on the output page
- $~ name of the current output report format (filehandle)
- $^ name of the current top-of-page format (filehandle_TOP)
- $<bar> force a flush after every write/print if non zero (0)
- $$ process number (PID) of the perl running the script
- $? status returned by the last pipe close, backtick or system
- $& the entire string matched by the last pattern match|
- Globals [3/6]
- $` everything before the matched substring
- $' everything after the matched substring
- $+ the last bracketed substring
- $* multiline matching withing a string? (0)
- $0 name of the file containing the perl script
- $N the Nth bracketed substring
- $[ index of the first element in an array/string (0)
- $] perl version|
- Globals [4/6]
- $; subscript separator for multi-dimensional arrays (\034)
- $! errno or error string
- $@ perl syntax error message from the last eval
- $< real uid of this process
- $> effective uid of this process
- $( real gid(s) of this process
- $) effective gid(s) of this process
- $: chars where perl can split continuation fields (" \n-")|
- Globals [5/6]
- $^D debugging flags
- $^F maximum system file descriptor (2)
- $^I inplace-edit extension
- $^P internal debugging flag
- $^T time at which the script began running
- $^W warning switch
- $^X name that Perl was executed as (argv[0])|
- Globals [6/6]
- $ARGV the name of the current file when reading from <>
- @ARGV the array of command line arguments
- @INC perl include directory list (-l, "/usr/local/lib/perl", ".")
- %INC associative array of included files
- $ENV{expr} environment variables
- $SIG{expr} signal handlers|
- gmtime(EXPR)|
- goto LABEL|
- grep(EXPR,LIST)|
- Help Me ObiWan Kenobi, You’re My Only Hope!
- To get help about using ObiWan, close and reopen the window, then
- type “a” and hit return.|
- hex(EXPR)|
- HotKeys For ObiWan [1/4]
- You can open the ObiWan window with the following hot key:
- command-` Pops up ObiWan. This also closes the window if it’s
- already open.
- Typing any printable character will enter it into the current text.
- You can then perform other actions using other hot keys.
- The following hot keys are supported by ObiWan when its window is open:
- return Finds the keys for the current text.
- shift-return Searches the text of the database for the current text.|
- HotKeys For ObiWan [2/4]
- option-shift-return Web Search for the current text.
- option-return Selects a new database from the ObiWan Folder using
- the current text as the file name.
- If the current text is “C” then it selects the C procedure
- parser. If the current text is “Pascal” it returns to
- the default procedure parser. See below for more info on
- parsers.
- command-enter ‘Types’ the selection into the frontmost application.|
- HotKeys For ObiWan [3/4]
- You can achieve various other behaviours using more
- modifier keys:
- command-option-enter ‘Types’ the first line of the entry.
- command-option-shift-enter ‘Types’ the entire entry.
- command-shift-enter ‘Types’ the entry as a procedure call.
- The language of the call is determined
- by the current procedure parser.
- command-. Goes to the next entry.|
- HotKeys For ObiWan [4/4]
- command-, Goes to the previous entry.
- command-] Goes to the selected word’s entry.
- command-[ Returns to the most recent entry.
- In additon, other functions are accessible using the mouse:
- click Selects the word.
- command-click Selects the word and ‘types’ it.
- double-click Selects the word and finds it.|
- index(STR,SUBSTR,POSITION)|
- int(EXPR)|
- ioctl(FILEHANDLE,FUNCTION,SCALAR)|
- join(EXPR,LIST)|
- keys(ASSOC_ARRAY)|
- kill(LIST)|
- last LABEL|
- length(EXPR)|
- link(OLDFILE,NEWFILE)|
- listen(SOCKET,QUEUESIZE)|
- local(LIST)|
- localtime(EXPR)|
- log(EXPR)|
- lstat(FILEHANDLE)|
- m/PATTERN/gio|
- MasterYoda Database Processing Application
- You can use the Master Yoda application to build your own ObiWan databases.
- The application processes database files and prepares them for use with
- ObiWan. Database files are simple text files; you can get help on the file
- format from Master Yoda. Master Yoda also allows you to sort databases,
- merge, sorted databases, generate statistics on a database and select what
- characters constitute a word within a given database.|
- MissedClicks
- Yes, I know that ObiWan sometimes doesn’t respond to clicks. It’s not my
- fault! The clicks are disappearing somewhere in the system software; they
- never make it through to ObiWan. You can fix this problem by installing
- Matt Slot’s TSM Fix extension.|
- mkdir(FILENAME,MODE)|
- msgctl(ID,CMD,ARG)|
- msgget(KEY,FLAGS)|
- msgrcv(ID,VAR,SIZE,TYPE,FLAGS)|
- msgsnd(ID,MSG,FLAGS)|
- next LABEL|
- oct(EXPR)|
- open(FILEHANDLE,EXPR) [1/2]
- returns non zero on success (PID of subprocess for pipes)
- open(F,"file") input
- open(F,"<file") input (+< read/write)
- open(F,">file") output (+> read/write)
- open(F,">>file") append (+>> read/write)
- open(F,"<PIPE>prog") piped output
- open(F,"prog<PIPE>") piped input|
- open(FILEHANDLE,EXPR) [2/2]
- open(F,"-") STDIN
- open(F,">-") STDOUT
- open(F,">&FILE") dup FILE and open (>>&, <&, +>&, +>>&, +<&)
- open(F,"<PIPE>-") implicit fork, returns pid to parent, 0 to child
- open(F,"file") input
- open(F,"file") input
- open(F,"file") input|
- opendir(DIRHANDLE,EXPR)|
- ord(EXPR)|
- OtherDatabases
- Other databases that ship with ObiWan include:
- Words A list of words from Rogets Thesaurus;
- great for checking your spelling quickly.
- Perl Reference material for the Perl programming languange.
- HTML Reference material for the HTML markup language.
- Java Reference material for the Java programming languange.
- Force Reference material for the Mac OS APIs.|
- pack(TEMPLATE,LIST) [1/4]
- xN repeat x N times
- x* repeat x as many times as necessary
- pack("c2x2c2",65,66,67,68) gives "AB\0\0CD"
- pack("a4","abcd","x","y","z") gives "abcd"
- pack("aaaa","abcd","x","y","z") gives "axyz"
- pack("a14","abcdefg") gives "abcdefg\0\0\0\0\0\0\0"|
- pack(TEMPLATE,LIST) [2/4]
- A An ascii string, will be space padded.
- a An ascii string, will be null padded.
- c A signed char value.
- C An unsigned char value.
- s A signed short value.
- S An unsigned short value.
- i A signed integer value.
- I An unsigned integer value.
- l A signed long value.
- L An unsigned long value.|
- pack(TEMPLATE,LIST) [3/4]
- n A short in "network" order.
- N A long in "network" order.
- f A single-precision float in the native format.
- d A double-precision float in the native format.
- p A pointer to a string.
- v A short in "VAX" (little-endian) order.
- V A long in "VAX" (little-endian) order.
- x A null byte.
- X Back up a byte.|
- pack(TEMPLATE,LIST) [4/4]
- @ Null fill to absolute position.
- u A uuencoded string.
- b A bit string (ascending bit order, like vec()).
- B A bit string (descending bit order).
- h A hex string (low nybble first).
- H A hex string (high nybble first).|
- pick(PROMPT, VALUES)|
- pipe(READHANDLE,WRITEHANDLE)|
- pop(ARRAY)|
- Predefined Names see Globals|
- print(FILEHANDLE LIST)|
- printf(FILEHANDLE LIST)|
- push(ARRAY,LIST)|
- q/STRING/|
- rand(EXPR)|
- read(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
- readdir(DIRHANDLE)|
- readlink(EXPR)|
- recv(SOCKET,SCALAR,LEN,FLAGS)|
- redo LABEL|
- Regular Expressions [1/3]
- \w (\W) matches (non)alphanumeric (including _)
- \b (\B) matches (non)word boundaries
- \b matches backspace in a character class
- \s (\S) matches (non)whitespace
- \d (\D) matches (non)numeric
- \n, \r newline, carriage return
- \f, \t formfeed, tab
- \NNN octal character|
- Regular Expressions [2/3]
- \N the Nth bracketed substring
- $N as above, use $N outside patterns
- $+ the last bracketed substring
- $` everything before the matched substring
- $& the entire matched substring
- $' everything after the matched substring|
- Regular Expressions [3/3]
- <bar> alternatives /hello<bar>goodbye/
- ^ start of string (or after newline if $* is 1)
- $ end of string (or before newline if $* is 1)
- . any character except newline
- {n,m} match preceeding regexp between n and m times
- {n} match n times, equivalent to {n,n}
- {n,} match n or more times, equivalent to {n,infinity}
- * zero or more times, equivalent to {0,}
- + one or more times, equivalent to {1,}
- ? zero or one times, equivalent to {0,1}|
- rename(OLDNAME,NEWNAME)|
- require(EXPR)|
- reset(EXPR)|
- return LIST|
- reverse(LIST)|
- rewinddir(DIRHANDLE)|
- rindex(STR,SUBSTR,POSITION)|
- rmdir(FILENAME)|prog")|
- s/PATTERN/REPLACEMENT/gieo|
- scalar(EXPR)|
- seek(FILEHANDLE,POSITION,WHENCE)|
- seekdir(DIRHANDLE,POS)|
- select(FILEHANDLE)|
- semctl(ID,SEMNUM,CMD,ARG)|
- semget(KEY,NSEMS,SIZE,FLAGS)|
- semop(KEY,OPSTRING)|
- send(SOCKET,MSG,FLAGS,TO)|
- setpgrp(PID,PGRP)|
- setpriority(WHICH,WHO,PRIORITY)|
- setsockopt(SOCKET,LEVEL,OPTNAME,OPTVAL)|
- shift(ARRAY)|
- shmctl(ID,CMD,ARG)|
- shmget(KEY,SIZE,FLAGS)|
- shmread(ID,VAR,POS,SIZE)|
- shutdown(SOCKET,HOW)|
- sin(EXPR)|
- sleep(EXPR)|
- socket(SOCKET,DOMAIN,TYPE,PROTOCOL)|
- socketpair(SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL)|
- sort(SUBROUTINE LIST)|
- splice(ARRAY,OFFSET,LENGTH,LIST)|
- split(/PATTERN/,EXPR,LIMIT)|
- sprintf(FORMAT,LIST)|
- sqrt(EXPR)|
- srand(EXPR)|
- stat(FILEHANDLE) [1/4]
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
- _ special filehandle of the last stat'ed file
- -e File exists.
- -z File has zero size.
- -s File has non-zero size (returns size).|
- stat(FILEHANDLE) [2/4]
- -r File is readable by effective uid.
- -w File is writable by effective uid.
- -x File is executable by effective uid.
- -o File is owned by effective uid.
- -R File is readable by real uid.
- -W File is writable by real uid.
- -X File is executable by real uid.
- -O File is owned by real uid.|
- stat(FILEHANDLE) [3/4]
- -f File is a plain file.
- -d File is a directory.
- -l File is a symbolic link.
- -p File is a named pipe (FIFO).
- -S File is a socket.
- -b File is a block special file.
- -c File is a character special file.|
- stat(FILEHANDLE) [4/4]
- -u File has setuid bit set.
- -g File has setgid bit set.
- -k File has sticky bit set.
- -t Filehandle is opened to a tty.
- -T File is a text file.
- -B File is a binary file (opposite of -T).
- -M Age of file in days when script started.
- -A Same for access time.
- -C Same for inode change time.|
- study(SCALAR)|
- substr(EXPR,OFFSET,LEN)|
- symlink(OLDFILE,NEWFILE)|
- syscall(LIST)|
- sysread(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
- system(LIST)|
- syswrite(FILEHANDLE,SCALAR,LENGTH,OFFSET)|
- tell(FILEHANDLE)|
- telldir(DIRHANDLE)|
- time|
- times|
- tr/SEARCHLIST/REPLACEMENTLIST/cds|
- truncate(FILEHANDLE,LENGTH)|
- umask(EXPR)|
- undef(EXPR)|
- unlink(LIST)|
- unpack(TEMPLATE,EXPR)
- see also pack for a list of template characters|
- unshift(ARRAY,LIST)|
- utime(LIST)|
- values(ASSOC_ARRAY)|
- vec(EXPR,OFFSET,BITS)|
- wait|
- waitpid(PID,FLAGS)|
- wantarray|
- warn(LIST)|
- write(FILEHANDLE)|
- =|
-