in reply to Determining the regex for foo=bar

Aside from the issue BrowserUk pointed out, it might be easier using split:
my ($k, $v) = split /\s*=\s*/;

Replies are listed 'Best First'.
Re^2: Determining the regex for foo=bar
by johngg (Canon) on Mar 12, 2010 at 00:11 UTC

    It might be safer to add a limit to the split just in case there are more equals signs later in the line.

    while ( <$inFH> ) { chomp; my ($k, $v) = split /\s*=\s*/, $_, 2; ... }

    I hope this is of interest.

    Cheers,

    JohnGG