in reply to Trying to outgolf Python

I was able to come up with
sub{my%r;for(split$",shift){$h=$p=$i=0;while(/./g){if($p){$h+=('/'eq$& +)*2-1if$&eq$p}else{$h='/'eq$&}$p=$&;$r{$i++,$h}=1}}keys%r}
which is too long, but I don't have enough time to play with it any more :-(

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]