in reply to Replace placeholders in text in an elegant manner

Do you mean something like

$my_test =~ s/placehldr1|placehldr2|placehldr3/sole replacement/

or is each unique placeholder to be replaced by a unique replacement? (and what is the "needls/" in your narrative?)

On asking for help and How do I post a question effectively? and you may also want to search for "I know what I mean..."

Replies are listed 'Best First'.
Re^2: Replace placeholders in text in an elegant manner
by explodec14 (Novice) on Feb 27, 2010 at 20:22 UTC
    needles is a synonim for placeholders.

    Each placeholder has a unique replacement.
    The text can be like the following

    This is text with %%placeholder1%%.
    It can be with %%placeholder2%% too. %%placeholder1%% can appear more than one time in the text.
    My intention is to replace them with my replacements at one line and not to loop on the placeholders and replace them one by one.