while (){ s!<(.*?)>(.*?)!<$1>$2!g; # ^ here's the difference print; } __DATA__ a+2bcd a+2bcd #### output: a+2bcd a+2bcd