Member Rara Avis
The next step would indeed be SQL, but it would NOT be a natural progression. More like apples and oranges, and a complete rewrite. Probably a different language, too. (Perl does SQL, but PHP does it much more easily.) I have, so far, managed to avoid using a "real" database on the web, partly because I download most of the data to a local database application, but mostly because I don't like the way SQL is implemented on the Internet (through connections, rather than talking directly to the DB program). But, the technology hasn't improved in three years, and I doubt I'll be able to avoid it much longer.
Yes, you would "know" the email address was the first field simply because you wrote it as the first field. It's not uncommon to use variables (that don't really vary) to make it more intuitive. At the top of the program, for example, you may define $dbPoetEmail = 1; and then any time you reference the array, it would be as @info[$dbPoetEmail]. Perl hashes are another way to do the same thing, but a bit more advanced.
The $path variable is obviously set up before you open the disk file and can be anything you need it to be, either an absolute path or a relative path. Examples of an absolute path might be "/cgi-bin/database" (start at root / and then go to cgi-bin and then go to database) or "/www/database", while a relative path might be as simple as "database" (start where the program is running, in cgi-bin, and find the directory called database immediately under it).
You probably don't want to put data files in your document root (the www portion of your site), because then you have to take special precautions to protect them. Remember, I can point my browser to any directory in your www folder. In truth, those precautions have probably already been taken for you, but you never know about the next server you use. On the other hand, the cgi-bin is treated differently by the web server. You can't even view images from the cgi-bin on most systems, but can ONLY run programs. That usually prevents people from seeing the contents of data files.
You also have to have the directory for the database set up with the proper permissions. Remember, you're on a shared server and they usually don't want programs just writing files any old place. The CGI programs run as very low privileged users, usually, and can't write to the same folders you can access with FTP. That's a good thing. On Unix, I manage my own directories with telnet and the chmod command, but on NT you'll probably have to have the server admin do it for you. That's a bad thing.