Hello,

When writing a web-based application, what's the best way to structure your 
perl scripts?  Currently I have scripts written by function 
(add/delete/update).  However, the navigation between scripts after an action 
has occured (i.e. deleting a record) could be better.  I wrote a script below 
that performs a delete, however, I use the require function to return to the 
previous script and the header prints twice.  Is this a proper use of the 
'require' function and anyway to stop the header from printing twice?

My alternative is to merge scripts but scripts written by function appears to 
make debugging easier.

Thanks in advance for any help and thanks to Chris Devers for the help on my 
last question.

Regards,
Chad 

#####SCRIPT######

#Use CGI module to print header
print header();

#Assign data
$projname     = param("projname");
$document     = param("document");

#Create SQL - delete document record
$sql  = qq{DELETE FROM document WHERE projname="$projname" AND };
$sql .= qq{document="$document" };

#Prepare and execute
$st_handle = $db_handle->prepare($sql);
$st_handle->execute;

#Print document was deleted and return to document list
print "<div align=center><h6>The <u>$document</u> document was 
deleted!</h6></div><br>";
require "docnew.pl";  ###The script 'docnew.pl' also has 'print header();'








-- 
_______________________________________________
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to