in reply to perl string extract
Try making the comma optional?
$line =~ /logfile\s*=\s*([^,]*),?/; [download]