thanks for the info.
This is what I've got to work so far.
# brings in arrays song_title and song_files
&song_list;
&file_list;
#works by single elements
my %test = ($song_titles[0], $song_files[0],
$song_titles[1], $song_files[1]);
foreach my $key (keys %test) {
print qq[<br> Delete this File: $key <INPUT TYPE="checkbox" NAME="
+files" VALUE="$test{$key}">\n];
}
Whatever is selected is then passed on to another subroutine that takes the value of "file" and deletes the file
# check for tainted data
my $files = $q->param( "files") || error( $q, "couldn't read File valu
+e");
$files =~ /^([\/.\w.]+)$/;
# The "untainted" file is now in $1
$files = $1;
die "Bad filename" unless $files;
foreach ($files){
unlink($_);
}
However I still can't figure out how I would delete the song title that goes with the song file. How could I also pass the value of the key (song_title) along with the song file?
also I tried doing
my %test = (@song_titles, @song_files);
however, it printed out the first key right (song_title) but the next key contained the song file as the key and so on ...
thanks in advance... |