[Pdx-pm] filewise (not linewise) in-place editing?
Randall Hansen
randall at sonofhans.net
Wed Oct 20 18:22:39 CDT 2004
folks ~
i've just needed to munge a group of files to change and concatenate
data on several lines into one line. usually i do something like:
perl -pi -e 's/foo/bar/g' file1 ...
this wouldn't work, since -p reads input files linewise.
i wrote a little script to solve my problem, it resets $/ and sucks the
whole file into a variable, munges it, and writes it. is there a way
to do this in a one-liner, similar to the above*?
thanks,
r
and not including "./munge_in_place.pl 's/foo/bar/g' file1 ..." ;)
More information about the Pdx-pm-list
mailing list