Hmmm... I think I need to entirely rewrite my program. So far, these methods would work in other cases, but this one would be very problematic and complicated. I'd better think of a new way of doing things...
What I'm trying to do is create a guestbook script. Yes, I know that there are tons of free ones out there, but I'm too independant to do that. Here's how the program works:
The user fills out an html form and the information is sent off to a cgi data processing file. The processing file has a form processor file as well, so that it can read the name inputs from the html document.
First name:<input type="text" name="fname">
The file processing form reads the "name" field from the html files and assigns them to a variable.
So far, this is what the script kinda looks like:
#!/usr/bin/perl
require "formprocessor.cgi";
&ReadParse(*input);
$fname= $input{'fname'};
use Tie::File;
tie @array, 'Tie::File', 'replies.cgi' or die "oops";
$array[2] = "print \"$fname\"\;";";
untie @array;
_________________
This script is entitled reply.cgi, the script that contains the new data is replies.cgi. What tiefile does is it makes the file(replies.cgi, the file to be changed) into an array by the different lines. So what this does is it prints whatever they typed in on the html document onto the third line of that replies.cgi. Now what I need it to do is keep the information there and whenever somebody else submits information, it will simply add that information on. Splicing an array would work, except I could never control just how many lines of code would be on replies.cgi, creating hella array problems.
Perhaps somebody knows a better way of doing this! I tried to remember the KISS rule, but it seems I kinda blew it.
Also, if anybody knows of some good perl tutorials, that would be great. I've mastered most everything that pageresource.com has to offer, but it's not nearly enough.
Any help is greatly appreciated!