FORM/file-update/new HTML

I need to update links on a web page.
I made a CGI using perl to read a test file (with descriptions and URLs) and "plant" the HTMLed links to an already-existing web-page.

now- I made a form which receives a description and a URL - the goal is to append the new data to the text file (which holds all my links) and then activate the converting  utility (which plants the data in the web-page).

my form on the web page looks like this:
<form action=""
<B><U>Add a new Link:</U></B><BR>
Description: <input type=text name="description">
URL: <input type=text name="URL">
<input type=submit value="Submit this data">

and the CGI listing is:
# nameage.cgi
require ''


   print "Content-Type: text/html\r\n\r\n";
   print "<HTML><HEAD><TITLE>Error</TITLE></HEAD>\n";
   print "<BODY BACKGROUND=\"$
   print "<body>\n";
   print "URL: <B><I>$url</I></B> linked!\n";
   print "\n";
   print "<BR> <BR>\n";
   print "<CENTER><A HREF=\"\">BA$
   print "<BR><BR>\n";
   print "</body> </html>\n";
open( TEXTfile,">> ~/public_html/home")||die "$!\n";
print TEXTfile "$des\n";
print TEXTfile "$url\n";
exec '~/ ~/public_html/home';

(*)home (which resides at ~/public_html)
   is the test file with the links
(*)addlink.cgi - is the cgi

for some strange reason I get the "result" HTML on screen after submitting the data- - but I get no change in the 'home' data file and therefore no change in the web-page after executing the links->html perl utility.

What am I missing here?
Who is Participating?
arnondConnect With a Mentor Commented:
use the 'system' function instead of the 'exec'.

Bye..... :-)
Arnon David (make sure it's an A)
Try expanding the '~'s, and checking whether die "$!" said anything
shlomoyAuthor Commented:
Want points, arnond? BEG!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.