if($logfile =~ ^([a-zA-Z0-9\_/\s\-]+)$) { $logfile = $1; } else { die "Bad data in $logfile"; }