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