<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Earl C. Ruby III &#187; Perl</title>
	<atom:link href="http://earlruby.org/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://earlruby.org</link>
	<description>this must be the place</description>
	<lastBuildDate>Sat, 17 Dec 2011 22:20:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>One-line search and replace command using Perl</title>
		<link>http://earlruby.org/2009/09/one-line-search-and-replace-command-using-perl/</link>
		<comments>http://earlruby.org/2009/09/one-line-search-and-replace-command-using-perl/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 00:25:56 +0000</pubDate>
		<dc:creator>Earl Ruby</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://earlruby.org/?p=118</guid>
		<description><![CDATA[I&#8217;ve been using these one-line commands for over a decade. They&#8217;re a really easy way to do a search and replace across many files using a Perl regular expression. This example replaces all instances of the word &#8220;old&#8221; with the word &#8220;new&#8221; in &#8220;myfile&#8221;, saving the old file version as &#8220;myfile.bak&#8221;: # perl -i.bak -pe [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using these one-line commands for over a decade. They&#8217;re a really easy way to do a search and replace across many files using a Perl regular expression.</p>
<p>This example replaces all instances of the word &#8220;old&#8221; with the word &#8220;new&#8221; in &#8220;myfile&#8221;, saving the old file version as &#8220;myfile.bak&#8221;:</p>
<p><code># perl -i.bak -pe 's/old/new/g;' myfile<br />
</code></p>
<p>This replaces all instances of the word &#8220;old&#8221; with the word &#8220;new&#8221; in all of the .html files in the current directory:</p>
<p><code># perl -i.bak -pe 's/old/new/g;' *.html<br />
</code></p>
<p>This does the same thing, but also updates all .html files in all subdirectories:</p>
<p><code># find . -name '*.html' -exec perl -i.bak -pe 's/old/new/g;' {} \;<br />
</code></p>
<p>Hope you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://earlruby.org/2009/09/one-line-search-and-replace-command-using-perl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

