sub processing { my %upload; my $upload = "gal.db"; tie %upload, "DB_File", "$gal", O_CREAT | O_RDWR, 0644, $DB_BTREE or die "Cannot open file 'gal': $!\n"; ### # Setup our params ### my $edit = url_param('edit'); my $del = url_param('rem'); #################### # Check for DELETE call #################### if ($del ne "") { if (exists $upload{$del}) { my ( $filename, $title, $comments, $width, $height, $count ) = split ( /::/, $upload{$del} ); ### # Rewriting $filename to a .png ### my $thumbs = $filename; $thumbs =~ m/([a-zA-Z0-9]+)\.()/; $thumbs = "$1.png"; ### # Deleting files from both image folders ### delete $upload{$del}; unlink "$fullimagedir/$filename" or die "Cannot delete image: $!"; unlink "$fullthumbsdir/$thumbs" or die "Cannot delete image: $!"; print "