
		   Porting PERL to the Amiga

			David G. Grubbs

		 <dgg@ksr.com> or <uunet!ksr!dgg>
		   (or try <dgg@athena.mit.edu>)

			 May 15, 1990

================ Introduction

As a personal challenge, I have done a straight forward port of PERL to the
Amiga.  I have not used the ARP library.  Since ARP apparently has not been
accepted by Commodore, and I don't have the source, I didn't want to make use
of unsupported binaries.  Let's see what AmigaDOS 2.0 does for us.

I intended to change the base PERL code as little as possible by implementing
the Unix functions provided neither by the Manx compiler and libraries nor by
the Amiga libraries.  With a multitasking OS, Unix-like files (simple flat
byte streams with a single ctrl-J marking the end of line) and some Unix
compatibility help from the Manx compiler libraries, the Amiga runs most
normal Unix applications with little trouble.  On the other hand, trying to
use the Amiga's non-Unix features is another problem, one I have not yet
attacked in this version of Amiga PERL.  And porting some of the non-Amiga
Unix functions was beyond me.

Later sections will discuss how to build PERL on the Amiga, user visible
changes, support tools, library functions and future plans.

There are a many differences between Unix and AmigaDOS and there are many gaps
in my knowledge of both.  Feel free to hack on anything I did.  I'd appreciate
seeing improvements so I can use them.  Future work and planned improvements,
as discussed in later sections, will be performed in my exponentially
decreasing spare time.

Major items you should note:

   o 	I don't understand enough of the debugger internals to get "perl -d"
	to work.  Running perl with the "-d" option causes PERL to take
	much longer to run a PERL program, but the result is the same as running it
	with no switches at all.

   o 	Test 6 in "t/op.eval" tests a "call through fatal()" and hangs the
	system.  Since perl uses "longjmp" all over the place, the Manx
	debugger can't follow it.  This is the only
	"hang" or "crash" bug (that I ran into) I couldn't figure out.

   o 	Test 11 in "t/op.split" fails.  Using "split;" without arguments
	causes a "Search pattern not terminated" error.  This is a parser
	or tokenizer error I haven't looked at carefully.

   o 	Using the Amiga-provided "NIL:" (which is necessary when spawning
	processes for "system" or the `...` operator) caused all sorts of
	strange crashes.  It became necessary to use a "NULL:" handler.
	PERL will not work without it.  I have provided both a binary and
	the freely distributable source.

   o 	Test 7 in "t/base.lex" fails on a call to "int()".  I spent some
	time investigating this one and I have concluded that the Manx
	"modf()" function is broken.

	PERL handled all the intermediates properly in the expression handed
	to "int()", but "int()" treated its argument as signed when all
	32 bits were used.

	I tested and looked at the source to all 4 of Manx's floating point
	libraries and the other three had worse problems, so I stuck with
	the "default" Manx floating point library.

================ How to build and Install PERL on the Amiga

If you somehow got a binary distribution, you need to do the following:

   o 	Find a directory that has 300K free.  Place PERL and the required
	tools (echo, glob, pwd) in that directory.  (You can also put the rest
	of the tools there too, if you have room.) Add that directory to your
	PATH.  Note that the Makefiles and config.h assume some executables
	are in "Bin:".

   o 	Add the "NULL:" section from the "tools/null/MountList" file to your
	"devs:MountList" file, copy the "Null-Handler" file to the "l:"
	directory and type "mount NULL:".  If you want NULL: to be permanently
	available, add the "mount NULL:" command to your "s:Startup-Sequence".

   o	Don't forget to mount the standard pipe device: "mount pipe:"

   o 	(optional) Makedir "s:perl" and place the perl library files
	("lib/*.pl") files in it.

Otherwise, you will have to do a "Source Build and Installation"

I describe here how I built and installed it.  Experts will understand how to
modify this procedure if necessary.  Non-experts should try it my way first.
If you don't have a hard disk, give up now.  My working directory, not
counting the compiler stages or most of the tools, is 4 Meg in size.  I'd
plan on 10Meg during the build stage.  After that the objects can be deleted.

See the "Optional External Support Tools" section for additional information
on independent programs that will help out during execution.  This section
discusses only those programs needed to compile and install PERL.

1. First you need to install Manx C version 5.0.  Manx3.6 will certainly
   not work and to use Lattice would require some tweaking of the code.

    o 	Manx suggests installing their system in a directory called "Aztec"
	with sub-directories named "Bin", "Include", "asm" and "Lib."
	I have assumed in the "cc.c" program and the Makefiles that Manx 5.0
	has been installed in "sys:Aztec".  If that is not correct, you will
	have to edit "amiga/tools/Makefile" and "amiga/tools/cc.c".

    o 	This port of PERL assumes long ints.  It is probably possible to make
	it work with short ints, but, given the Unix bias in all the code
	(including the portion I have added), it will not be easy.

    o 	The libraries (c.lib and m.lib) in "sys:Aztec/Lib" are assumed to be
	small model, 32 bit, (and for "m", Manx floating point) libraries.

    o 	Though it is not documented in the manual, the Manx library and the
	fcntl.h header file provide and declare (respectively) a "mkdir"
	function this way: "int mkdir(char *_name);" Manx tries to look
	Unix-like, but blew it here.  Change the file
	"sys:Aztec/Include/fcntl.h" (as I did) to declare "mkdir" as "int
	mkdir(char *_name, int mode);"

    o 	If you plan to use a "cc" driver like mine, move "sys:Aztec/Bin/cc"
	to "sys:Aztec/Bin/ccom".  If you don't plan to use a "cc" driver,
	you will have to rewrite all three Makefiles.


2. Find a version of "make".  Without "make" the rest will be difficult.
   I suppose you could do it by hand, but the time is better spent
   finding a handy tool like "make" for use with your compiler.

   The Makefile works with the version of "make" provided by Manx, two
   PD makes, GNU make and Sun's make.  (Warning: the syntax is accepted
   and "make -n" shows the right list of commands, but Unix make won't
   understand the "copy" and "join" commands.)

   For some PD examples, look at Fish Disks 2, 45, 69, 179 & 246.

3. The new Amiga support files and the diffs to the main PERL source will
   probably show up as "patch" files.  When you are done installing the
   files, you should have an "amiga" sub-directory in the main perl
   directory, a "tools" sub-directory below that and a "patch"
   directory below that.

   If you are short on space, you can delete unnecessary files from the main
   perl directory.  You *must* remove any "config.h" file other than the one
   I provided and keep the following files in the build directory:

  	a. Two sub-directories: "amiga" and "t" (the test files.)

	b. EXTERN.h	INTERN.h	arg.h		array.c
	   array.h	cmd.c		cmd.h		cons.c
	   consarg.c	doarg.c		doio.c		dolist.c
	   dump.c	eval.c		evalargs.xc	form.c
	   form.h	handy.h		hash.c		hash.h
	   patchlevel.h	perl.h		perl.y		perly.c
	   regcomp.c	regcomp.h	regexec.c	regexp.h
	   spat.h	stab.c		stab.h		str.c
	   str.h	toke.c		util.c		util.h

4. Find a version of "yacc" or "Bison".  (Note: If you don't use "bison",
   you'll have to change $(YACC) in the Makefile.) You have three choices:

    o 	Grab one of the PD versions of Bison or yacc and "port" it yourself.

    o 	Use one of the versions of Bison or Yacc already ported to the
	Amiga.  Bison versions are on Disks 4, 51, 105, 136 & 155
	Yacc shows up on Fish disk 299.

	Patches to make "Bison1" on Fish disk #155 work with Manx 5.0 in
	"my" environment are in "amiga/tools/patches."

    o 	Or you can run your Unix yacc or bison on the file and copy over the
	perl.c and perly.h files to the "perl" directory.


5. Make the "cc" command.

	If you have installed Manx 5.0 as described above, you can "cd" to
	"amiga/tools" and type "make installcc".

	If you don't like "sys:Aztec" as a base for your Manx 5.0 system,
	you will have to change the three lines in cc.c that refer to it.

6. Make "unix.lib"

	If you have installed the source files, Manx 5.0, "make" and "cc"
	as described above, you can "cd" to "amiga" (up one level from the
	tools directory) and type "make".  The "unix.lib" library will
	be created and the few files that need to be copied to the main perl
	directory will be copied up there.

7. Make the tools.

	Once the unix.lib library is made, this step is independent of the
	later ones.  You can skip this a come back later if you like.

	Cd to the "amiga/tools" directory and type "make".  If you have
	room, type "make install".  If you are tight on space, type
	"make installmust" to get the three tools that are used for internal
	purposes: glob  (used in the "<*>" construct) , pwd & echo.

8. Make perl.

	"cd" to the main perl directory and type "make".  It should take
	about an hour on a 68000 with a hard disk.

9. Install perl.

	Check $(bin) and $(privlib) in the main Makefile.  If you change
	$(privlib) you'll have to change PRIVLIB in config.h and rebuild.

	Check the Makefile install step, then type "make install".
	You now have an executable PERL program and the standard "lib"
	routines in the "s:perl" directory.

10. IMPORTANT final item: Install the NULL: handler as described in the
    "Binary Installation" section above.  Make sure you "mount null:" and
    "mount pipe:".

================ Functional Differences

First, read the PERL manual.  I have not monkeyed with the syntax or structure
of the PERL language.  Command line options, variables, literals, statements,
operators, arithmetic functions, formats, regular expressions and functions
dealing with arrays, lists and strings are unchanged.

Though the number of functional differences appears large, there are really
only a few general differences with lots of side-effects.  I've tried to
comment on all the differences I've found.  For some info on the compilation
environment, take a look at the "amiga/config.h" file.

>>>>>>>> File System Differences

   o	The parent directory is "/", not ".." and the current directory is
	"" (a clumsy object to work with), not ".".  Since "." and ".." are
	not special, I wrote an internal function ("amigaizepath()", not
	accessible through PERL) to translate Unix pathnames to Amiga
	names.  It has the following effects:

	- "../" strings preceeded by any non-alphanumeric character are
	  turned into "/", so "../../xyz" ==> "//xyz".

	- "./" strings preceeded by any non-alphanumeric character are
	  removed, so  "./xyz" ==> "xyz"

	- "~/" at the front of a pathname is replaced with the value of
	  the environment variable "HOME", if you have it set.

	- Simple ".." and "." are turned into "/" and "".

	- Special: "/dev/null" ==> "NULL:", "/dev/tty" and "/dev/console"
	  are turned into "CON:".

	- Any path beginning with "/" is left alone.

	- The result is that a few otherwise valid Amiga pathnames ("..") are
	  not directly usable.

   o	Filenames are case *insensitive*.  One effect of this is that the
	habit of some of the PERL test scripts ('t' subdirectory) of using
	a capitalized name of the PERL script as a temporary file, writes
	over the script.  It also means that Amiga PERL should probably have
	a "case insensitive compare" operator.  It currently doesn't.

   o	Temporary files are placed in "ram:".  The temp files for the "-e"
	command line option are named "ram:perl-eXXXXXX".

   o	AmigaDOS has no hard or symbolic links.  Given that I hear they will
	show up in AmigaDOS 2.0, I wasn't about to emulate them.

   o	Open files are special on the Amiga.  You may not move them.  If open
	for writing, you may not read them.  And you must close them before
	deleting them, even if they were only open for reading.  Some of the
	test scripts failed to close the filehandle before trying to unlink.

   o	The file system doesn't provide Creation or Access times on files.
	See the later comment on the "stat()" function.

>>>>>>>> Differences in Process Creation

   o	There is no straight "fork()" function in AmigaDOS.  It might be
	possible to create one, but without the sources to AmigaDOS, I am
	out of luck.

   o	"system" and "exec" use "Execute" when it looks like a shell command
	string.  See the "Amiga Shell" section below.  Otherwise they use the
	"fexecv" and "execvp" commands provided by the Manx library.

   o	The `...` operator and the open("|...") or open("...|") functions
	use "Execute" to perform their functions.  See the "Amiga Shell"
	section below for some limitations.

   o	Watch out when using the "-|" and "|-" pseudo filenames in an "open()"
	function.  They are documented as producing a "fork", which is not
	available.  I made the operation work by starting another perl as if
	you had used the command: `perl`.  This is expensive (until I can make
	some form of shared library), but without "fork()" wer're stuck.

   o	Using `perl -e "command"` has the same problem.  Perl is big.  Also,
	the syntax of the "command" must satisfy the interpretation by PERL,
	interpretation by the Amiga Shell, then interpretation by the "child"
	PERL.  Talk about UUUgleeee.

   o	"Execute" and "fexec" do not "fork()".  They do something weird and
	wonderful inside AmigaDOS.  The result is they inherit internally
	Open()ed AmigaDOS filehandles attached to stdin & stdout,
	but not other AmigaDOS file handles, file descriptors, stdio FILE*
	handles or process data.  The effects of "dup", "fdopen" and the like
	are lost across an Execute.  In particular, the hack of combining
	stderr with stdout doesn't work.  See the "Amiga Shell" section.

>>>>>>>> The Amiga Shell

   o	This could be considered an offshoot of the "Process Creation" section
	since the main reason the Amiga Shell gets in the way is that the
	`...` operator, and the system/exec functions (via the AmigaDOS
	Execute function) use the default shell.

   o	There are shells that allow a more sophisticated or more Unix-like
	command syntax, (I use one normally.) but none of them are "standard".
	The standard Shell is limited in many ways when compared to the
	Unix shells to which PERL normally has access.

   o	There are no pipes "|" and no `...` operator available.

   o	The default shell has no variables and doesn't evaluate environment
	variables (e.g. $HOME) in any way.  You can use $ENV{} inside PERL,
	or use `getenv VAR`, if you installed the "getenv" command, but
	"system 'echo $HOME'" will echo '$HOME'.

   o	The command separator is not a semicolon (';'), but the strange
	construct: "+\n".  This is really a hack since a + at the end of a
	line is a "continuation" character.

   o	The default Amiga shell requires the I/O redirection to be *first* on
	the command line before the arguments.  There must be no space between
	the '>' or '<' and the filename.

   o	There is no Shell syntax to combine stderr with stdout.
	Just for the hell of it, so some "perl -e 'xxx 2>&1'" statements
	would work, I had perl understand the argument "2>&1" and do the
	"dup()" inside perl.  So for a PERL command only, you can combine
	stderr with stdout.  I did not generalize the action.

   o	Quoting is strange in the Shell.  The backslash ('\') and single quote
	("'") characters are just characters and are not used in quoting.  The
	double quote is the only quotation character.  To get a '"' in the
	command (required by PERL commands if passed in by "-e") you have to
	double it.  Example:

	The command found in the test script "t/op.script":

		$x = `./perl -e 'print "ok\n";`;

	Has to be done this way:

		$x = `./perl -e "print \"\"ok\\n\"\"";`;

   o	#!
	Unfortunately, neither the Amiga Shell nor AmigaDOS has any support
	for the automatic execution of a script language.  I wrote a shell
	that can be made to understand the !# construct or some suffix (like
	.pl) to allow automatic execution.  This has two implications:

		1. You must type "perl script" every time.
		2. The "-S" command line option is not really useful.
		   Since you have to type the pathname (unless it is in
		   the PRIVLIb -- s:perl) anyway, having "-S" search the
		   PATH adds no value.

	[Note:  There is a "SCRIPT" bit in the file mode, but it doesn't do
		anything I can see.  If it ever works it certainly will not
		understand "#!".  But it might allow the "-S" hack to work.]

   o	Despite the above, the "-S" option will work if you "setenv PATH" to
	a *comma* (',') separated list.  The colon (':') is reserved for
	the last character of a device specifier in AmigaDOS.

>>>>>>>> Miscellaneous Manx and AmigaDOS anomalies

   o	Even though the Amiga has a "PIPE:" device, without a real "fork()"
	the "pipe()" function is not really useful to the user level of PERL.
	The PIPE: device also has a 4K limit on the buffer.  Since I start
	the `...` processes asynchronously, this should not be a problem in
	normal use, but it means you can't write more than 4K at a time from
	an external program started by `...` or the open("...|") function.

   o	Environment variables exist in two forms: AmigaDOS and Manx/Rokicki.
	I chose to use the AmigaDOS form, so I had to write a non-Manx pair
	of setenv/getenv functions.  I also wrote simple user programs to
	get at these, though the AmigaDOS versions should work fine.

   o	BCPL programs (all the standard AmigaDOS programs) will not handle
	append redirection (">>").  In fact, it crashes the system.  Also,
	most BCPL programs will not take input from stdin when there are no
	arguments.  I use the ARP tools, which are more Unix-like in other
	ways, too.

   o	AmigaDOS keeps no process CPU utilization, so no "times()" function.

   o	Some scripts depend on the exact values of "errno"  They are different
	under AmigaDOS.  For example: ENOENT is 1 on the Amiga, 2 on Unix.

   o	I am told there is no supported way to get a "lock" from a Filehandle,
	which is required to implement "fstat()" in C.  This disables all
	"stat" and filetest operations on PERL filehandles.  I'm told
	AmigaDOS 2.0 will fix this.

   o	The uid and gid functios and variables all return 0.  This makes you
	the "root", which is appropriate on the Amiga, where you have access
	to everything.  The one glitch is that while Unix can't read/write
	protect	files against the "root", AmigaDOS can.  So you may have to
	use the "eval '$> = 1;';" hack or do a "stat()" to find the real
	answer in a "-r" or "-w" filetest operation.  Alternatively, I could
	use another environment variable or the UID/GID of 1.

   o	There is a stubbed out "kill()" function.  I didn't take the time to
	implement a cross product of Unix and Amiga signal and exception
	handling.  This is a realm for possible future development.

   o	"gmtime()" works if you set the TZ environment variable.

	The Manx library looks at the TZ environment variable, skipping the
	first 3 characters.  It then converts the rest to a number and *adds*
	it to the local time to create GMT.  This is backward.

	The official value of the EST timezone is -0500, 5 hours earlier than
	GMT.  Adding -5 to GMT should produce EST, not the other way around.

	In practical terms, you should use the "setenv" I (or the Amiga, but
	not Manx) provide and type:

		"setenv TZ GMT5"	For Eastern.	(should be GMT-5)
		"setenv TZ GMT6"	For Central.	(should be GMT-6)
		"setenv TZ GMT7"	For Mountain.	(should be GMT-7)
		"setenv TZ GMT8"	For Pacific.	(should be GMT-8)

   o	Unlink/rm will work on empty directories normally.

   o	I tried to emulate the Unix stat structure and mode bits so Unix code
	will still work, but I had to find some place to stick the 4 Amiga
	specific protection bits: Delete, Pure, Script and Archive.  I think
	I've done it in a reasonable way.  Take a look at stat.h and stat.c.

   o	Chmod has to interact with stat to agree on the protection bits.

   o	filetest operators will not work on FILEHANDLES (with the possible
	exception of -t).

   	The significance of Real and Effective uids is
	nil.  The "owner", "group" and "other" bits are OR'd together when
	the mode is set and duplicated when the mode is read.  So the
	-[WRX] operators are equivalend to the -[rwx]

   	filetest operators "-[oO]" are always true.

   	filetest operators "-[ugklpSbc]" are always false.
	(Some attempt was made to allow -c to work on devices like"NULL:".)

>>>>>>>> Command line options

   o 	The text handling command line options appear to work.  On the other
	hand, the options dealing with something external to the PERL
	executable have some trouble:

   o 	"-d" does not start the debugger as it should.

   o 	"-e" is heavily dependent on Amiga Shell quoting syntax.  Single
	quotes are not understood.

   o 	"-P" does call "cpp", if you have it installed, but it requires
	an explicit "perl -P" command, since there is no automatic
	execution of script files.

   o 	"-S" should work if you set the PATH variable to a comma separated
	list of paths via the AmigaDOS setenv or the one I provide.  It is not
	all that useful, though, since it assumes there is *some* script
	language that can start the whole thing up.  You can run the Amiga
	"execute" command, but would you rather type "execute" or "perl"?

   o 	"-u" will not work.  There is no way to "dump core" on the Amiga.

   o 	"-U" since directories can be unlinked on the Amiga, this option is
	not meaningful, though it may get in the way.


>>>>>>>> Missing PERL functions

   o	Socket functions might be done using Amiga ports, but I didn't take
	the time to implement them.  So the following functions are missing:

	accept		bind		connect		getpeername
	getsockname	getsockopt	listen		recv
	send		setsockopt	shutdown	socket
	socketpair	select (the bitmask version)

   o	The Unix table-reading functions could be implemented, but they
	have no immediate use.  So the following functions are missing:

	getpwnam	getgrnam	gethostbyname	getnetbyname
	getprotobyname	getpwuid	getgrgid	getservbyname
	gethostbyaddr	getnetbyaddr	getprotobynumber getservbyport
	getpwent	getgrent	gethostent	getnetent
	getprotoent	getservent	setpwent	setgrent
	sethostent	setnetent	setprotoent	setservent
	endpwent	endgrent	endhostent	endnetent
	endprotoent	endservent

   o	The following functions have no meaning or don't work under AmigaDOS:

	chroot		dump		fcntl		flock
	fork		getpgrp		link		lstat
	readlink	setpgrp		symlink		times
	wait

   o	The following functions could be written, but haven't been: (Future?)

	crypt		dbmopen		dbmclose	syscall
	getpriority	setpriority	kill


>>>>>>>> Altered PERL functions

  o  chdir	Affects whole process, so sub-tasks chdir also -- not an
		exact parallel with the Unix concept.

  o  getlogin	Returns the value of the environment variable "HOME".

  o  getppid	Returns 1.  This is wrong, since 1 is a valid process.

  o  ioctl	Works only on tty's and only to do raw/cooked mode.  And that
		is only because the Manx library allows it.  No other use.

  o  open	This mostly works, but see the "Process Creation", "Amiga
		Shell" and "Filesystem" sections above.

  o  dup, dup2	Since I wrote these, they are not well supported by the Manx
		and Amiga layers below them.  They are certainly not
		visible after a "system" or "exec".

  o  pipe	It exists, but it will probably hang up the process, since
		there is no fork and having the reader and writer in one
		process could wedge everything up.

  o  stat	See above and look at the "stat.h" and "stat.c" files.

  o  umask	It will take a mask and return the last one, affecting nothing.


>>>>>>>> Variables

  o  $!		Error numbers are different.

  o  $<, $>, $(, $)	Uid, Euid, Gid, Egid all return 0.


  o  $0		Real argv[0] inside a C program is unavailable under AmigaDOS,
		but since you have to type "perl script", anyway, this should
		be the name of the script.

  o  $SIG{}	Returns signal numbers and names, but their effect has not
		been tested.

================ Optional External Support Tools

   o	The PERL a2p & s2p functions were not ported.  I saw no need to
	port these, as 'awk' and 'sed' are little used on the Amiga.

   o	If you invoke PERL with the "-P" option, it will fail unless you have
	a 'sed' in your path.  I tried the "GNU" sed, but it has a bug that
	appears in the main Unix version as well as on the Amiga that hits
	the exact functionality required by PERL.  It has been reported.
	On Fish Disk #128 I found a broken version of sed.  Patches to make
	this version work are in the "amiga/tools/patch" directory.

   o	If you invoke PERL with the "-P" option, it will fail unless you have
	a 'cpp' in your path.  I found a workable version on Fish Disk #28.
	Patches to get this version to compile under Manx 5.0 and work in
	"my" environment in the "amiga/tools/patch" directory.

   o	"ARP" used to be the "AmigaDOS *Replacement* Project".  Then they got
	smart (or greedy?) and tried to get Commodore to accept their ideas.
	This caused a change to the "AmigaDOS *Resource* Project".  In either
	case, they provide a library of all sorts of useful functions and a
	set of user level replacement programs that are far superior to the
	standard ones.

	Despite this praise and my everyday use of both the commands and the
	library for my activities, I didn't use the library in PERL because
	Commodore has not accepted it.  Some of the functionality will
	probably appear in AmigaDOS 2.0.  When that version of the OS shows
	up, I'll see what I can improve.

   o	I provide source to a bunch of small tools:

	glob	Unix (csh) glob, except '\n' as separator, not '\0'.
	echo	Unix echo (wildcards ok, "-n" as in BSD)
	cat	Unix cat (wildcards ok)
	rm	Unix rm (wildcards ok, "-f" overrided "Protect", "-r" works)
	mkdir	Unix mkdir (no wildcarding).

	env	Walks through ENV: and prints your environment variables. 
	getenv	Prints an environment variable.
	setenv	Sets an environment variable.

	false	"Exit(1)" like the Bourne shell helper function.
	true	"Exit(0)" like the Bourne shell helper function.

	pwd	Prints your Present Working Directory
	prpath	Prints your AmigaDOS PATH (different from "getenv PATH")
	which	Searches your PATH and prints all occurrences of argument.

	readdir	*VERY* simple "dir".
	scdir	"dir" that uses Manx's "scdir()" function for [*?] expansion.

	stat	"Stat()" a file and print the "stat" structure.
	tasks	A "ps" command.


   o	Other useful tools I can't live without:

	less	Fish Disk #149.
	csh	I wrote my own shell, but there are PD versions and commercial
		versions.  The standard Amiga Shell is too limited for normal
		activities, especially if you've used Unix.
	rcs	Fish Disk #281 and #282  Includes "diff" and "ed".
	mg2a	An early version (1b) of this editor was available on Fish Disk
		#131. Version 2a was posted to comp.sources.{misc,unix} some
		time ago.  I heard of an mg3 out there somewhere, also.
	

================ Bugs and Weaknesses

   o	The Uid/Gid handling is not the best.
   o	memory allocation in the Amiga support code is not clean.
   o	Error returns and error recovery need looking at.

================ Likely Future Enhancements

   o	dbm (use gdbm)
   o	case insensitive operators.
   o	filetest operators for DELETE, PURE, ARCHIVE and SCRIPT bits.
   o	Syscall to Amiga library functions.
   o	PERL commands to perform Amiga window and graphics commands.
   o	Make as much as possible a shared library.
   o	Add PERL commands for random Amiga DOS functions like "assign", ...
   o	fstat
   o	stat improvements:
		Save 'st_comment' (Amiga comment field) in 'struct stat'.
		Save the real DateStamp in 'struct stat'.
		Save real Protection word.
		Calculate st_dev from some disk # or mount address.  Currently
		the DiskKey is treated as an "inode".  (I'd like this to
		allow a simple "am I on the same disk?" test.)

   o	Write an "open" function to go along with "close", "dup", "dup2".
	This would allow a cleaner interface to "dup" and would allow new "file
	types" for any program that uses this "open".


================ Possible Future Enhancements

   o	Map the other file types (fifo, socket, etc.) to tty's and Msg ports?
   o	Flesh out the "kill()" function.
   o	Implement signals and handlers.
   o	Fix "sleep()" to break on interrupt.
   o	Make filetest operator -c work.
   o	Fix gmtime.
   o	Emulate most of the socket calls using msg ports.
   o	Group and Passwd functions.  Might be useful.
   o	umask:  If I have my own "open" and "mkdir" I can make this useful.

   o	Make use of the SCRIPT bit.

   o	stderr is handled oddly.  It is explicitly aimed at the Amiga "*"
	file, which is your console.  It is impossible to redirect using
	the Amiga shell, so I added recognition of a "2>&1" argument to PERL.
	We could also do "2>/dev/null" or arbitrary remapping "#>&#".


   o	ARexx	I purchsed ARexx because it will be part of the next AmigaDOS release.
	There is a temptation to add ARexx "ports" to PERL to "join the gang",
	but without a doubt, "Rexx" is the worst script language I have ever
	seen.  It is to PERL what JCL was to a real computer language: a
	clumsy, ugly language designed for use by IBMers who didn't know any
	better.  Yuck!

	The best thing that could happen is for PERL to *replace* ARexx, not
	coexist with it.  Who knows.  Maybe future development on Amiga PERL
	will offer the same level of support as ARexx.

	For now, I'll leave it as "Yuck!"

   o	If I write my own "open" then I could fake links, hard and symbolic.
	lstat(), symlink(), link(), readlink() would work again.
	It would only be usable by programs using my "open", but I'll put
	it into a library.  This could be superceded by AmigaDOS 2.0
