Next: , Previous: Evaluation, Up: Interactive Perl


3.4 Mutilation

Sepia contains several functions to operate on regions of text using the interactive Perl process. These functions can be used like standard one-liners (e.g. `perl -pe ...'), with the advantage that all of the functions and variables in the interactive session are available.

M-x sepia-perl-pe-region <RET> code <RET>
Evaluate code on each line in the region with $_ bound to the line text, collecting the resulting values of $_. With a prefix argument, replace the region with the result.
M-x sepia-perl-ne-region <RET> code <RET>
Evaluate code as above, but collect the results instead.
M-x sepia-perlize-region <RET> code <RET>
Evaluate code once with $_ bound to the entire region, collecting the final value of $_. With a prefix argument, replace the region.