<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: The Perl Flip Flop Operator</title>
	<atom:link href="http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/feed/" rel="self" type="application/rss+xml" />
	<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/</link>
	<description>Leveraging Perl and Emacs</description>
	<lastBuildDate>Tue, 07 May 2013 11:25:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8513</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Tue, 30 Nov 2010 06:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8513</guid>
		<description><![CDATA[Good point in this specific case Tom. I&#039;ve amended the post to make the utility more obvious.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Good point in this specific case Tom. I&#8217;ve amended the post to make the utility more obvious.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Legrady</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8511</link>
		<dc:creator><![CDATA[Tom Legrady]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 22:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8511</guid>
		<description><![CDATA[It&#039;s the unneccessary use of the flip-flop operator that concerns me.

jared@localhost $ cat flip-flop.muse \
&gt; &#124; perl -ne &#039;print if /^10:22:25/ \
&gt; &#124; mail jared]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s the unneccessary use of the flip-flop operator that concerns me.</p>
<p>jared@localhost $ cat flip-flop.muse \<br />
&gt; | perl -ne &#8216;print if /^10:22:25/ \<br />
&gt; | mail jared</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8510</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 21:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8510</guid>
		<description><![CDATA[@Evan - I don&#039;t find the behaviour surprising - rather than having global state, I&#039;d say it&#039;s acting like a closure, or an object.  If it didn&#039;t behave like this when called multiple times I&#039;d be more surprised.

@Rhombold - that is a neat trick.  That&#039;s two things I&#039;ve learned today.  Cheers!]]></description>
		<content:encoded><![CDATA[<p>@Evan &#8211; I don&#8217;t find the behaviour surprising &#8211; rather than having global state, I&#8217;d say it&#8217;s acting like a closure, or an object.  If it didn&#8217;t behave like this when called multiple times I&#8217;d be more surprised.</p>
<p>@Rhombold &#8211; that is a neat trick.  That&#8217;s two things I&#8217;ve learned today.  Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rhomboid</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8509</link>
		<dc:creator><![CDATA[Rhomboid]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 17:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8509</guid>
		<description><![CDATA[You can get rid of the head -n-1 stuff by checking the return value of the flip-flop.  The return value is a number representing the count, and when the ending condition is met (i.e. the flip-flop is transitioning from true to false) then this number is returned with a trailing E0 such that it&#039;s still numeric but can be distinguished, that is &quot;5E0&quot; is still parsed as the number 5 but it&#039;s different than &quot;5&quot;, so:

$ seq 1 100 &#124; perl -ne &#039;print if (/^22/ .. /^26/) =~ /^\d+$/&#039;
22
23
24
25

The last line is omitted.]]></description>
		<content:encoded><![CDATA[<p>You can get rid of the head -n-1 stuff by checking the return value of the flip-flop.  The return value is a number representing the count, and when the ending condition is met (i.e. the flip-flop is transitioning from true to false) then this number is returned with a trailing E0 such that it&#8217;s still numeric but can be distinguished, that is &#8220;5E0&#8243; is still parsed as the number 5 but it&#8217;s different than &#8220;5&#8243;, so:</p>
<p>$ seq 1 100 | perl -ne &#8216;print if (/^22/ .. /^26/) =~ /^\d+$/&#8217;<br />
22<br />
23<br />
24<br />
25</p>
<p>The last line is omitted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Carroll</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8508</link>
		<dc:creator><![CDATA[Evan Carroll]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 16:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8508</guid>
		<description><![CDATA[See this question on StackOverflow for some added esoterism:
http://stackoverflow.com/questions/2143554/is-perls-flip-flop-operator-bugged-it-has-global-state-how-can-i-reset-it]]></description>
		<content:encoded><![CDATA[<p>See this question on StackOverflow for some added esoterism:<br />
<a href="http://stackoverflow.com/questions/2143554/is-perls-flip-flop-operator-bugged-it-has-global-state-how-can-i-reset-it" rel="nofollow">http://stackoverflow.com/questions/2143554/is-perls-flip-flop-operator-bugged-it-has-global-state-how-can-i-reset-it</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8506</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 13:53:55 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8506</guid>
		<description><![CDATA[Hi LeoNerd,

That&#039;s a neat trick that I wasn&#039;t aware of, thanks!

But that wasn&#039;t the reason, no.  I always process files starting with cat because I usually need to process multiple files and build up my pipelines iteratively.  E.g.

cat log2010* &#124; grep blah &#124; awk &#039;{ ... }&#039; ...
cat log2010* &#124; awk &#039;/blah/ { ... }&#039; &#124; perl -ne ...
cat log2010* &#124; perl -ne &#039;...&#039;]]></description>
		<content:encoded><![CDATA[<p>Hi LeoNerd,</p>
<p>That&#8217;s a neat trick that I wasn&#8217;t aware of, thanks!</p>
<p>But that wasn&#8217;t the reason, no.  I always process files starting with cat because I usually need to process multiple files and build up my pipelines iteratively.  E.g.</p>
<p>cat log2010* | grep blah | awk &#8216;{ &#8230; }&#8217; &#8230;<br />
cat log2010* | awk &#8216;/blah/ { &#8230; }&#8217; | perl -ne &#8230;<br />
cat log2010* | perl -ne &#8216;&#8230;&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LeoNerd</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8505</link>
		<dc:creator><![CDATA[LeoNerd]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 12:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8505</guid>
		<description><![CDATA[Your deliberate use of cat; would that perhaps be to keep the filename first in a left-to-right reading? If so, you know you can do

$ &lt;flip-flop.muse \
  perl -ne ....

Shell redirections can come before the command.]]></description>
		<content:encoded><![CDATA[<p>Your deliberate use of cat; would that perhaps be to keep the filename first in a left-to-right reading? If so, you know you can do</p>
<p>$ &lt;flip-flop.muse \<br />
  perl -ne &#8230;.</p>
<p>Shell redirections can come before the command.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention The Perl Flip Flop Operator « A Curious Programmer -- Topsy.com</title>
		<link>http://curiousprogrammer.wordpress.com/2010/11/29/the-perl-flip-flop-operator/#comment-8504</link>
		<dc:creator><![CDATA[Tweets that mention The Perl Flip Flop Operator « A Curious Programmer -- Topsy.com]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 07:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1406#comment-8504</guid>
		<description><![CDATA[[...] This post was mentioned on Twitter by Naveed Massjouni, Perl Bits. Perl Bits said: The Perl Flip Flop Operator http://bit.ly/feAuVe [...]]]></description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Naveed Massjouni, Perl Bits. Perl Bits said: The Perl Flip Flop Operator <a href="http://bit.ly/feAuVe" rel="nofollow">http://bit.ly/feAuVe</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
