I am working on a perl module and looking for an output (line) of the form: a:value1 OR a:value2 OR a:value3 OR ...
The values value1, value2, value3...
are in the array (e.g. @values).
I know that we could use join( ' OR ', @values )
to create a concatenated form string: value1 OR value2 OR value3 OR ...
But, as you see above, I need to add an extra a:
for each value.
What would be a neat way to do this?
source share