my $inputfile; print "\nDrag and drop a file here:\n"; chomp ($inputfile = ); $inputfile =~ s/^ *[\"\']?([^\"\']*)[\"\']?/$1/; # strip whitespace and quotes if (-e "$inputfile") {print "\nOK, file found\n";} else {print "\nERROR: file not found\n";}