lex2001 has asked for the wisdom of the Perl Monks concerning the following question:
The print statement in the foreach loop doesn't make a whole lot of sense but it was the only thing I could come up with to pass the value of the filename. I know I will need to use unlink to remove the files but as you can see I'm not there yet. Any suggestions are appreciated.#### # Get File List #### sub get_file_list { my $dfiles = "/Library/WebServer/Documents/userpages/uploads"; opendir(DIR,$dfiles); my @files = grep { $_ ne '.' && $_ ne '..' } readdir(DIR); closedir(DIR); print<<HTML; <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO +-8859-1"> <title>Upload - Delete Files</title> </head> <body bgcolor="#ffffff"> <form action="upload.cgi" Method="post" ENCTYPE="multipart/form-da +ta"> <P>List of Files: <br> HTML foreach (@files) { print "<br> Delete this File: <INPUT TYPE=\"submit\" NAME=\"action\" V +ALUE=\"$_\">\n"; } print<<HTML; <br> <br> <INPUT TYPE="submit" NAME="action" VALUE="Submit"> <INPUT TYPE="submit" NAME="action" VALUE="Delete"> </FORM> HTML }
Edit: chipmunk 2001-11-18
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Allow User to Select Which Files to Delete
by fuzzysteve (Beadle) on Nov 18, 2001 at 20:07 UTC | |
by lex2001 (Sexton) on Nov 19, 2001 at 15:27 UTC | |
by fuzzysteve (Beadle) on Nov 19, 2001 at 16:51 UTC |