in reply to Emacs, cperl and electric parens question

Getting outside of the "last" parenthesis would probably take some lisp code but getting outside the current parenthetical enclosure is forward-list, which is normally bound to C-M-n (Control Meta n).

I guess the lisp code to get to the last (enclosing) parenthesis wouldn't be too difficult (for a lisp programmer ... which I am not). I'd probably try a recursive call to forward-list + forward-char until forward-char fails.

As an extra pointer, you might get something from "paredit" of Lisp mode. There are a few other parenthesis functions like M-) and Esc-) but they've never worked as I'd expect.