<?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/"
		>
<channel>
	<title>Comments on: To Mail a File Elegantly &#8211; Python or Perl?</title>
	<atom:link href="http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/</link>
	<description>Simple code hopefully worth remembering</description>
	<lastBuildDate>Thu, 08 Apr 2010 05:33:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: admin</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-15</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-15</guid>
		<description>The path argument is untidy as it reveals things to the recipient that they don&#039;t need to know and my paranoid self never likes to give too much away if I can help it.  But yes you are right any of those solutions are quite usable.  The regex really is there as an illustration of a point about typical Perl coding approaches rather than the way things should be done.</description>
		<content:encoded><![CDATA[<p>The path argument is untidy as it reveals things to the recipient that they don&#8217;t need to know and my paranoid self never likes to give too much away if I can help it.  But yes you are right any of those solutions are quite usable.  The regex really is there as an illustration of a point about typical Perl coding approaches rather than the way things should be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chorny</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-14</link>
		<dc:creator>chorny</dc:creator>
		<pubDate>Sun, 26 Jul 2009 09:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-14</guid>
		<description>You need a &#039;Filename&#039; argument for $msg-&gt;attach only if it differs from real name or use &#039;Data&#039; instead of &#039;Path&#039;, so there is no need for file name extraction, just use &#039;Path&#039; argument. And in any case file name extraction is better done with File::Spec module (for example, it would work on VMS).

sitedesign: I prefer to use MIME::Lite even when sending through sendmail executable.</description>
		<content:encoded><![CDATA[<p>You need a &#8216;Filename&#8217; argument for $msg-&gt;attach only if it differs from real name or use &#8216;Data&#8217; instead of &#8216;Path&#8217;, so there is no need for file name extraction, just use &#8216;Path&#8217; argument. And in any case file name extraction is better done with File::Spec module (for example, it would work on VMS).</p>
<p>sitedesign: I prefer to use MIME::Lite even when sending through sendmail executable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sitedesign</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-13</link>
		<dc:creator>sitedesign</dc:creator>
		<pubDate>Sun, 26 Jul 2009 03:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-13</guid>
		<description>Would also like to point out that of the various options available there are not enough options that deal with direct email to smtp servers.  Most bash options such as mutt and mail require there be a local MTA installed.

The reasons behind the above two scripts was for an option that sent email directly to a SMTP server and not via a local MTA.

Being a python fan, I have to admit that I would probably choose the perl script for it&#039;s simplicity.

A database person we know said he likes perl because it, &quot;Is still a scripting language and does what you need it to do without too much effort.&quot;

I would add that is true, but only after you get your head around perl.

I had a look for a good netcat script but found none.</description>
		<content:encoded><![CDATA[<p>Would also like to point out that of the various options available there are not enough options that deal with direct email to smtp servers.  Most bash options such as mutt and mail require there be a local MTA installed.</p>
<p>The reasons behind the above two scripts was for an option that sent email directly to a SMTP server and not via a local MTA.</p>
<p>Being a python fan, I have to admit that I would probably choose the perl script for it&#8217;s simplicity.</p>
<p>A database person we know said he likes perl because it, &#8220;Is still a scripting language and does what you need it to do without too much effort.&#8221;</p>
<p>I would add that is true, but only after you get your head around perl.</p>
<p>I had a look for a good netcat script but found none.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sitedesign</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-12</link>
		<dc:creator>sitedesign</dc:creator>
		<pubDate>Sun, 26 Jul 2009 03:30:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-12</guid>
		<description>Aaah, But as we discussed at work on Friday, you don&#039;t get to set a payload in the perl version.</description>
		<content:encoded><![CDATA[<p>Aaah, But as we discussed at work on Friday, you don&#8217;t get to set a payload in the perl version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-11</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 25 Jul 2009 05:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-11</guid>
		<description>I agree with Perl being more readable than Python in this case.  It&#039;s just nicer to look at too.  On the other hand Perl tends to hide function in plain sight too, which is why I used the regex next to &lt;a href=&quot;http://perldoc.perl.org/Getopt/Long.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Getopt::long&lt;/code&gt;&lt;/a&gt;.  So take another look at it, everywhere but the regex is readable, and Perl is known for its cryptic regex code: whereas while the Python example is long winded, nothing about it requires any real mental gymnastics to understand what is being done on any line.  So the illustration is that in one way Perl is more readable but in another Python is.  A dead heat yet again.

However if it was simply a choice between the two snippets of illustrated code, I certainly prefer the Perl because of its elegance and shear class, and would use &lt;code&gt;Getopt::&lt;/code&gt; instead of the code I&#039;ve used in the example.</description>
		<content:encoded><![CDATA[<p>I agree with Perl being more readable than Python in this case.  It&#8217;s just nicer to look at too.  On the other hand Perl tends to hide function in plain sight too, which is why I used the regex next to <a href="http://perldoc.perl.org/Getopt/Long.html" rel="nofollow"><code>Getopt::long</code></a>.  So take another look at it, everywhere but the regex is readable, and Perl is known for its cryptic regex code: whereas while the Python example is long winded, nothing about it requires any real mental gymnastics to understand what is being done on any line.  So the illustration is that in one way Perl is more readable but in another Python is.  A dead heat yet again.</p>
<p>However if it was simply a choice between the two snippets of illustrated code, I certainly prefer the Perl because of its elegance and shear class, and would use <code>Getopt::</code> instead of the code I&#8217;ve used in the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chorny</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/to-mail-a-file-elegantly-python-or-perl/144/comment-page-1/#comment-10</link>
		<dc:creator>chorny</dc:creator>
		<pubDate>Fri, 24 Jul 2009 19:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=144#comment-10</guid>
		<description>IMHO Perl version is way more readable than Python&#039;s. And if you want better command line parsing in Perl, you should use an Getopt:: module. In your case it would be Getopt::Long.</description>
		<content:encoded><![CDATA[<p>IMHO Perl version is way more readable than Python&#8217;s. And if you want better command line parsing in Perl, you should use an Getopt:: module. In your case it would be Getopt::Long.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
