<?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>Dushkin.org &#187; perl</title> <atom:link href="http://www.dushkin.org/tag/perl/feed/" rel="self" type="application/rss+xml" /><link>http://www.dushkin.org</link> <description>Citizen of the Internet</description> <lastBuildDate>Sun, 01 Aug 2010 17:35:05 +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>Perl script for converting between currencies</title><link>http://www.dushkin.org/2009/10/23/perl-script-for-converting-between-currencies/</link> <comments>http://www.dushkin.org/2009/10/23/perl-script-for-converting-between-currencies/#comments</comments> <pubDate>Fri, 23 Oct 2009 18:55:17 +0000</pubDate> <dc:creator>dushkin</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[mac os x]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[quicksilver]]></category> <category><![CDATA[script]]></category><guid isPermaLink="false">http://www.dushkin.org/?p=355</guid> <description><![CDATA[Hello there dear readers, I&#8217;ve been working on a little command line utility this afternoon to convert between different currencies google style. Instead of googling &#8220;10 USD in EUR&#8221; every time, you can simply type the same in the command line and get the result straight from your terminal. My intention was originally to make [...]]]></description> <content:encoded><![CDATA[<p>Hello there dear readers,</p><p>I&#8217;ve been working on a little command line utility this afternoon to convert between different currencies google style. Instead of googling &#8220;10 USD in EUR&#8221; every time, you can simply type the same in the command line and get the result straight from your terminal.</p><p>My intention was originally to make this script into a <a href="http://docs.blacktree.com/quicksilver/quicksilver">Quicksilver</a> utility. It could easily be done by having an applescript supply the data to  but unfortunately Applescript seems <strong>broken</strong> in Quicksilver on Snow Leopard and I still haven&#8217;t had the chance to try to fix it.</p><p>In case this one caught you by surprise &#8211; yes, there&#8217;s actually a version of Qucksilver that <a href="http://code.google.com/p/blacktree-alchemy/downloads/detail?name=Quicksilver-b56a7.tar.gz&amp;can=2&amp;q=">works fine with Snow Leopard</a>.</p><h3>Installing this script</h3><ol><li>Install <code><a href="http://search.cpan.org/~lgoddard/Finance-Currency-Convert-Yahoo-0.2/Yahoo.pm">Finance::Currency::Convert::Yahoo</a></code>. <strong>To do this</strong>:<ol><li>Start <code>cpan</code></li><li>Type: <code>install Finance::Currency::Convert::Yahoo</code></li></ol></li><li>Put the script somewhere you like</li><li>Make sure it&#8217;s executable (chmod +x ./currency.pl)</li><li>Done!</li></ol><h3>Using this script</h3><p>Couldn&#8217;t be any easier:</p><blockquote><pre>% ./currency.pl 100 USD in EUR
66.58 EUR</pre></blockquote><p>And that&#8217;s it!</p><p>It also takes other forms of input. For instance:</p><ul><li>&#8220;10USD in GBP&#8221;</li><li>&#8220;USD10 in GBP&#8221;</li><li>&#8220;USD 10 JPY&#8221;</li><li>&#8220;$20.10 in cny&#8221; (keep in mind that you will need to escape that dollar sign or the shell might think it needs to do something with it)</li></ul><p>The basic rule of thumb is that the <strong>first</strong> currency is the source, the <strong>second</strong> is the target and that a number is the value in the source currency. You may only supply ONE of each.</p><p><strong>Note:</strong> I added a substitution from &#8220;NIS&#8221; (New Israeli Shekel) to ILS (Israeli Shekel). Yahoo prefers the code ILS while I prefer NIS, no biggie.</p><h3>License</h3><p>Public domain, baby.</p><h3>Getting the script</h3><p><a href="http://www.dushkin.org/code/currency.pl">Save this file</a>. Then see above instructions.</p><h3>Changelog</h3><ul><li><a href="http://www.dushkin.org/code/currency-1.0.pl">1.0</a><ul><li>Released</li></ul></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.dushkin.org/2009/10/23/perl-script-for-converting-between-currencies/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
