in reply to how to indent/pretty print perl code
Use emacs in batch mode.
With this emacs lisp code in file "perl-indent.el":
(cperl-mode) (indent-region 0 (buffer-size) nil) (save-buffer)
And this emacs command line call:
> emacs -batch try.pl -l .emacs -l perl-indent.el
This file "try.pl":
#!/usr/bin/perl -w use strict; for (1) { print "emacs rules"; } while (1) { print " ... at least in viper mode\n"; }
turns into:
#!/usr/bin/perl -w use strict; for (1) { print "emacs rules"; } while (1) { print " ... at least in viper mode\n"; }
The call to the ".emacs" initialization file is necessary since emacs won't load it per default in batch mode, and you want your personal indentation preferences to be used, of course.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Re: how to indent/pretty print perl code
by ZZamboni (Curate) on Nov 02, 2000 at 21:20 UTC | |
by clemburg (Curate) on Nov 02, 2000 at 21:30 UTC | |
by ZZamboni (Curate) on Nov 03, 2000 at 18:35 UTC |
In Section
Seekers of Perl Wisdom