while ($sth=~/sth(sth)/g) {} #### $mycopyofstring=$sth; while ($mycopyofstring=~s/sth(sth)//) { }