NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Do it in Perl (Score:2)
Or thereabouts. Seems to me that you don't need to switch the parms, but rather switch their bind numbers.
It's a quick throwaway tool, but that's
--
xoa
Re:Do it in Perl (Score:1)
perl -0777 pi.bak -e 's/\(1, ([^\)]+)\)(.*?)\(2, ([^\)]+)\)/(1, $3)$2(2, $1)/gs' file.plDisclaimer: Not tested extensively.
here's some small improvements (Score:2)
The "r" is useful to change one character ("R" will overwrite a bunch of chars, it's like insert mode but overwrites).
The "ddp" switches the current line with the next. It is a variant on the very useful (especiall
vi is like perl (Score:2)
I found that my initial use of vi was adequate, but that every 6 months or a year I would read through the vi manual and pick a few more useful idioms and add them to the set that I knew well enough to use without thinking. After a few years of this, my vi repertoire was large enough that most of the new idioms I tried to learn were not useful o
vim: C-A C-X (Score:2)
<C-A>ddpk<C-X>
Re:vim: C-A C-X (Score:1)
Also, to make it even easier, a temporary binding can be created using map.
Of course, a better (preferably unused) key may be used in place of
I just chose that as it is rarely used, I think.Finally, something I know... (Score:1)
Buck