$_="+2\"0->6+w-43-28-Q-20-5+K+g+1+f-1/-13-8+7+L-13-48-13+12-1-A-1-43"; s/[">\/A-wild;]/ord$&/eg;while( /[-+]\d+/g ){ @a or @a=($&) and next; unshift @a, map {($_+$&)/2 => ($_-$&)/2} pop @a; } print map chr, @a;