in reply to lowercasing during a match?

Is there a Perlish way to do this all in one go?

/e can be your friend. Try this:   $raw =~ s/(\S+?)\s*=\s*(\S+)/$params{lc($1)} = $2/ge; It's destructive on $raw, but that's easy enough to work around if you care.