in reply to Regular Expressions Match Repititions

You can extract both, the key and the value in one go. Maybe you want some sanity checking on the key or maybe not:

if ($param) { $param =~ /^(id|key|limit):(\S*)$/ or die "Malformed value for par +ameter: '$param'"; my ($key,$value) = ($1,$2); $ENV{"C:$key"} = $value; };

If you don't want the sanity check on the parameters, for easy extensibility, it gets even shorter:

if ($param) { $param =~ /^(\w+):(\S*)$/ or die "Malformed value for parameter: ' +$param'"; my ($key,$value) = ($1,$2); $ENV{"C:$key"} = $value; };