require 'cgi.pm'; use File::Path; $dir_location = "/home/sites/www.domain.net/web/test/"; %in = (); &ReadParse(%in); # Parse the data submitted by the user if (($in{'sub_dir'})) { $dir= $in{'sub_dir'}; rmtree(['$dir_location','$dir'], 1, 1);