<?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: Perl source filters: evil or not?</title>
	<atom:link href="http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/feed/" rel="self" type="application/rss+xml" />
	<link>http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/</link>
	<description>(notes from an average programmer studying the hard stuff)</description>
	<lastBuildDate>Thu, 21 May 2009 01:17:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: draegtun</title>
		<link>http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/#comment-2280</link>
		<dc:creator>draegtun</dc:creator>
		<pubDate>Mon, 13 Oct 2008 14:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://lispy.wordpress.com/?p=323#comment-2280</guid>
		<description>Well if you use Source Filters in ones own programs then we&#039;re all old enough to accept the trade off &amp; consequences!   If you&#039;re using it in programs that get released to the wild then make sure it does come with a government health warning attached ;-)

I think one of the problems with Source Filters is that it screws up the Perl debugger.  Thus the slippery slope starts!

In terms of literature, Simon Cozens does have a small section on Source Filters in &quot;Advanced Perl Programming&quot;.

The modern alternative being pushed instead of Source Filters is &lt;a href=&quot;http://search.cpan.org/dist/Devel-Declare/&quot; rel=&quot;nofollow&quot;&gt;Devel::Declare&lt;/a&gt;.  This works on the bytecode instead of the source code.   Its early doors at the moment but it does show great promise.

/I3az/</description>
		<content:encoded><![CDATA[<p>Well if you use Source Filters in ones own programs then we&#8217;re all old enough to accept the trade off &amp; consequences!   If you&#8217;re using it in programs that get released to the wild then make sure it does come with a government health warning attached <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I think one of the problems with Source Filters is that it screws up the Perl debugger.  Thus the slippery slope starts!</p>
<p>In terms of literature, Simon Cozens does have a small section on Source Filters in &#8220;Advanced Perl Programming&#8221;.</p>
<p>The modern alternative being pushed instead of Source Filters is <a href="http://search.cpan.org/dist/Devel-Declare/" rel="nofollow">Devel::Declare</a>.  This works on the bytecode instead of the source code.   Its early doors at the moment but it does show great promise.</p>
<p>/I3az/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lispy</title>
		<link>http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/#comment-2276</link>
		<dc:creator>lispy</dc:creator>
		<pubDate>Thu, 09 Oct 2008 16:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://lispy.wordpress.com/?p=323#comment-2276</guid>
		<description>Sorry for the irritating error, Mark.  I use Perl in three different environments, so I generally forget which way the slashes go until I get shell complaint.  Yeah, it works without it as I normally don&#039;t take the time to chmod stuff.</description>
		<content:encoded><![CDATA[<p>Sorry for the irritating error, Mark.  I use Perl in three different environments, so I generally forget which way the slashes go until I get shell complaint.  Yeah, it works without it as I normally don&#8217;t take the time to chmod stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/#comment-2274</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 09 Oct 2008 15:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://lispy.wordpress.com/?p=323#comment-2274</guid>
		<description>Why are you using backslashes in the shebang line at the top? Does that even do anything? Won&#039;t your code work fine without that line?</description>
		<content:encoded><![CDATA[<p>Why are you using backslashes in the shebang line at the top? Does that even do anything? Won&#8217;t your code work fine without that line?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://lispy.wordpress.com/2008/10/08/perl-source-filters-evil-or-not/#comment-2272</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Thu, 09 Oct 2008 00:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://lispy.wordpress.com/?p=323#comment-2272</guid>
		<description>Source filters are definitely evil and the online Perl community will generally try to dissuade you from using them. In some extremely limited cases they are useful, but as a regular code structuring tool they are evil evil evil. That is why you won’t find much mention of it in the literature. It is, for all intents and purposes, impossible to transform Perl code correctly.

Translating a non-Perl format that has bits of Perl embedded inside it to Perl is OK, so long as you take care never to try to parse the Perl bits, which mainly means parsing the file while considering the Perl bits opaque. (Eg. if you put Perl inside XML: an XML parser won’t care that the text nodes it finds contain Perl, and if there’s any need to use XML metacharacters inside Perl code you have to escape them in the Perl code according to the XML rules. There is then never any ambiguity.)

As for Moose, its popularity is simply too new for the module to have found its way into any printed Perl literature.

You are definitely trying to do moderately unusual things and based on the fact that you say they are part of a “dream” project, this should really not be surprising to you. :-)

I don’t really get why you aren’t just writing a proper parser for an external DSL instead of translating to Perl, though.</description>
		<content:encoded><![CDATA[<p>Source filters are definitely evil and the online Perl community will generally try to dissuade you from using them. In some extremely limited cases they are useful, but as a regular code structuring tool they are evil evil evil. That is why you won’t find much mention of it in the literature. It is, for all intents and purposes, impossible to transform Perl code correctly.</p>
<p>Translating a non-Perl format that has bits of Perl embedded inside it to Perl is OK, so long as you take care never to try to parse the Perl bits, which mainly means parsing the file while considering the Perl bits opaque. (Eg. if you put Perl inside XML: an XML parser won’t care that the text nodes it finds contain Perl, and if there’s any need to use XML metacharacters inside Perl code you have to escape them in the Perl code according to the XML rules. There is then never any ambiguity.)</p>
<p>As for Moose, its popularity is simply too new for the module to have found its way into any printed Perl literature.</p>
<p>You are definitely trying to do moderately unusual things and based on the fact that you say they are part of a “dream” project, this should really not be surprising to you. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I don’t really get why you aren’t just writing a proper parser for an external DSL instead of translating to Perl, though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
