Help for this page
s/(.)</$1=!=</gs; # use some distinct pattern to mark open brackets s/>(?!=!=)/>=!=/g; # and close brackets that aren't adjacent to "<" @tokens = split( /=!=/ );