#!/usr/bin/perl open P,shift;%p=('>',sub{$p++},'<',sub{$p--},'+',sub{$p[$p]++},'-', sub{$p[$p]--},'.',sub{print chr$p[$p]},',',sub{$p[$p]=ord getc},'[' ,sub{&c} ,);sub p{ exists$p{$_[0]}&&&{$p{$_[0]}}}p getc P until eof P; sub c{push@c,getc P until$c[@c-1]eq']';do{p$_ for@c}while$p[$p]}