in reply to Editor with Perl

VIM Vi(Imroved) already has the perl interp built into it. You can write perl subs to manipulate the browser in exactly the way you describe.
--

Zigster