P> more t/rev sub rv{1>=length $_[0]?$_[0]:substr( $_[0],-1).rv(substr $_[0],0,-1)} $_=<>;chomp; print rv($_);