lakeTrout has asked for the wisdom of the Perl Monks concerning the following question:
$linenumber is the value passed to the delete CGI$logfile = "tempfile.tmp"; $logfileOrig = "logfile.log"; chmod 777, $logfile; #the 777 is for testing, chmod 777, $logfileOrig; #it won't be WIDE open sub makeff { #copy existing logfile to tempfile, while skipping record I want d +eleted open (LOGFILE, ">$logfile") or die("Can't Open Log File at $logfil +e"); open (ORIG, "<$logfileOrig") or die("Can't Open Log File at $logfi +leOrig"); while (my $origLine = <ORIG>) { $currentline ++; print LOGFILE $origLine unless $currentline == $linenumber; } close (ORIG); close (LOGFILE); rename $logfile, $logfileOrig if $linenumber; }
print OUTFILE "<FORM NAME=\"FORM\" METHOD=\"POST\" ACTION=\"del +ete.cgi\">"; print OUTFILE "<input type='hidden' name='linenumber' value='$l +inenumber'>"; print OUTFILE "<INPUT TYPE=SUBMIT VALUE=\"DELETE THIS RECORD\"> +</FORM><br>\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: chmod/chown problem with httpd
by oko1 (Deacon) on Apr 10, 2008 at 23:52 UTC | |
by lakeTrout (Scribe) on Apr 11, 2008 at 00:07 UTC | |
|
Re: chmod/chown problem with httpd
by ikegami (Patriarch) on Apr 10, 2008 at 23:13 UTC | |
|
Re: chmod/chown problem with httpd
by ikegami (Patriarch) on Apr 10, 2008 at 23:15 UTC | |
|
Re: chmod/chown problem with httpd
by cdarke (Prior) on Apr 11, 2008 at 11:02 UTC |