my $input = 'foo+bar+baz'; my $i = 1; my $string = join '&', map { 'keyword' . $i++ . '=' . $_ } split /\+/, $input;