Your regex:
if ($line =~ /logfile\s*\=\s*(.+?)\s*\,/){unilaterally matches a comma and so does not seem to match the OP's requirement to match with or without a comma.
In reply to Re^2: perl string extract
by eyepopslikeamosquito
in thread perl string extract
by anu_1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |