while () { if (/aaaa$/) { $/ = '%'; while () {} # I tried it with and without this loop } }