Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Perldo in Emacs

2 views
Skip to first unread message

Alberto Simões

unread,
Mar 2, 2011, 4:17:38 PM3/2/11
to help-gn...@gnu.org
Hello

vim has a nice thing, it lets the user to use a command named
'perldo', supply some code to it, and vim will process all the file
with perl, and include the output.

My doubt is if there is something similar in Perl (I know we have send
through pipe, but was expecting some dedicated method).

If not, it should not be difficult to implement, but I really need
some help with the list.
It is a matter of running the buffer with

perl -i -pe ' ... ' < buffer > newbuffer

where ... is the perl code instroduced by the user in emacs
(minibuffer, probably).

Thanks
ambs

--
Alberto Simões

Yuri Khan

unread,
Mar 2, 2011, 11:32:42 PM3/2/11
to help-gn...@gnu.org
2011/3/3 Alberto Simões <hash...@gmail.com>:

> It is a matter of running the buffer with
>
>  perl -i -pe ' ... '    < buffer > newbuffer
>
> where ... is the perl code instroduced by the user in emacs
> (minibuffer, probably).

shell-command-on-region will almost do what you want, you will just
need to pass it a newly created buffer for output.

Jorgen Grahn

unread,
Mar 3, 2011, 4:45:54 AM3/3/11
to
On Wed, 2011-03-02, Alberto Simões wrote:
> Hello
>
> vim has a nice thing, it lets the user to use a command named
> 'perldo', supply some code to it, and vim will process all the file
> with perl, and include the output.
>
> My doubt is if there is something similar in Perl (I know we have send
^^^^
You mean Emacs here.

> through pipe, but was expecting some dedicated method).
>
> If not, it should not be difficult to implement, but I really need
> some help with the list.
> It is a matter of running the buffer with
>
> perl -i -pe ' ... ' < buffer > newbuffer
>
> where ... is the perl code instroduced by the user in emacs
> (minibuffer, probably).

Just an observation: I find myself using 'perl -ne' just as often as
'perl -pe', so if vim only supports the former, it's a bit too limited
for my taste.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Vagn Johansen

unread,
Mar 3, 2011, 1:32:19 PM3/3/11
to
Yuri Khan <yuri...@gmail.com> writes:

Type C-u first

C-u M-| ..

--
Vagn Johansen

0 new messages