I understand that’s a very simple question but I really failed googling it. =(
I’ve got something like this:
$a =~ s/(\w*)/--word was here--/g;
And I want to put into a log file which words were replaced.
aa 123 bb 234 cc → --word was here-- 123 --word was here-- 234 --word was here--
And that’s okay, but I want to remember aa, bb and cc and write into a log file. What should I do?
In fact I have a link remover script but I need to remember which links were removed. I tried to simplify my task for you but made it much harder to understand – sorry.
You can use the
emodifier which evaluates the right side as an expression: