home / experts / perl / tutorial / 3 |
|
|
PerlHoo, Part IIStoring User Recommendations
Now we must deal with a few issues related to storing new site recommendations. When a user
wants to recommend a new site for a particular category, he/she clicks the link labeled
Suggest new link at the bottom of the directory page. This link is created dynamically
in the
When the user completes the form and clicks the Submit Resource button, the data is sent
back to the script. Assuming the form method is POST, the File PermissionsBecause we're writing to files now, we must make sure that our Web server has proper permissions. Make sure the PerlHoo directory defined in the$rootdir variable on Line 32 is
writable by your Web server.
File LockingTheadd_link subroutine stores new site recommendations in a CSV file when
the user clicks the Submit Resource button. This can cause a race condition where multiple
users submit a new site simultaneously. In such a case, only the second set of data would be added
to the file.
To solve this potential problem, |
home / experts / perl / tutorial / 3 |
|
Produced by Jonathan
Eisenzopf and
Created: April 20, 1999
Revised: April 21, 1999
URL: http://www.webreference.com/perl/tutorial/3/