[sf-perl] My perl idiom/"I like" of the moment

Joe Brenner doom at kzsu.stanford.edu
Wed May 12 11:11:06 PDT 2010


I've got a script I call "deep_rename" that takes a list of "s///g"
commands, and crunches through them applying them to everything in
a tree, including the file names.

I've thought it would be funny to give a lighting talk about it some
time, where the joke would be that it's too frightening to want to use
it very often.

In practice, something like your approach where you can monitor
what it's doing is usually more practical.

Doing it inside your editor would seem to make sense, but there's
usually problems with that...  For example, there's the emacs
query-replace (M-%), and query-replace-regexp (C-M-%), but then you
don't get to use perl regexps, and if you've got more than a few
transformations to do on each file, they'd be too awkward.
(The "query" commands don't work well in keystroke macros, either.)



More information about the SanFrancisco-pm mailing list