in reply to lowercasing during a match?

It is possible, but using a while loop is better:

my $raw = "foo=1 baR= red BOO = 5.6 Baz =3"; my %params = (); use Benchmark qw/cmpthese/; my $test = { 'map' => sub { %params = map { (lc($_) => $raw =~ /$_\s*=\s*(\S+)/ ) } $raw =~ /(\S+)\s*=/g; %params = (); }, 'while' => sub { $params{lc($1)} = $2 while $raw =~ /(\S+)\s*=\s*(\S+)/g; %params = (); } }; #no regexp initialisation in benchmark $_->() for values %$test; cmpthese( -4 , $test );
--
http://fruiture.de