in reply to subsitutuion operator

I thought you said that you were using an array? Arrays have indexes, my friend, and you can use a for loop to go through the array a remember the lines you like. Otherwise, you can use grep to create a new array with only the lines you want to process
perl -e "@a=('ordr 1:56\n','Rply 1:0\n', 'Time 1:January 24, 2001 (4:3 +0pm)\n'); print grep {/^R.*/} @a;"
and put them back into the original array later on.

Celebrate Intellectual Diversity