<?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>beer planet &#187; Perl</title> <atom:link href="http://beerpla.net/tag/perl/feed/" rel="self" type="application/rss+xml" /><link>http://beerpla.net</link> <description>where things have nothing to do with beer - tutorials, tips, how-tos, thoughts, hacks, and other techy nonsense</description> <lastBuildDate>Fri, 06 Jan 2012 08:50:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel='hub' href='http://beerpla.net/?pushpress=hub'/> <item><title>Hidden Features Of Perl, PHP, Javascript, C, C++, C#, Java, Ruby, Python, And Others [Collection Of Incredibly Useful Lists]</title><link>http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/</link> <comments>http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/#comments</comments> <pubDate>Sun, 21 Jun 2009 19:38:56 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[C]]></category> <category><![CDATA[C Sharp]]></category> <category><![CDATA[C++]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Databases]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[asp.net]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[code]]></category> <category><![CDATA[delphi]]></category> <category><![CDATA[Eclipse]]></category> <category><![CDATA[emacs]]></category> <category><![CDATA[f#]]></category> <category><![CDATA[feature]]></category> <category><![CDATA[featured]]></category> <category><![CDATA[flash]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[greasemonkey]]></category> <category><![CDATA[haskell]]></category> <category><![CDATA[hidden]]></category> <category><![CDATA[http]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[language]]></category> <category><![CDATA[lua]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[objective-c]]></category> <category><![CDATA[oracle]]></category> <category><![CDATA[program]]></category> <category><![CDATA[regex]]></category> <category><![CDATA[ror]]></category> <category><![CDATA[ruby on rails]]></category> <category><![CDATA[scala]]></category> <category><![CDATA[secret]]></category> <category><![CDATA[spring]]></category> <category><![CDATA[tcl]]></category> <category><![CDATA[vb.net]]></category> <category><![CDATA[xpath]]></category> <category><![CDATA[xslt]]></category> <guid
isPermaLink="false">http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/</guid> <description><![CDATA[<h2 align="left">Introduction</h2><p><a
href="http://www.stackoverflow.com">StackOverflow</a> is an amazing site for coding questions. It was created by <a
href="http://twitter.com/Spolsky" rel="nofollow">Joel Spolsky</a> of <a
href="http://joelonsoftware.com" rel="nofollow">joelonsoftware.com</a>, <a
href="http://twitter.com/codinghorror" rel="nofollow">Jeff Atwood</a> of <a
href="http://codinghorror.com" rel="nofollow">codinghorror.com</a>, and some other incredibly smart guys who truly care about user experience. I have been a total fan of SO since it went mainstream and it&#039;s now a borderline addiction (you can see my StackOverflow badge on the right sidebar).</p><h2 align="left">The Story</h2><p
align="left"><div
class="note"><div
class="noteimportant"></div></div></p><p
align="left"><strong>Update 6/21/09</strong>: This server is currently under very heavy load (10-200), even with caching plugins enabled. Please bear with me as I try to resolve the situation.</p><p
align="left">Feel free to <a
href="http://www.addtoany.com/share_save?&#38;linkurl=http%3A%2F%2Fbeerpla.net%2F2009%2F06%2F21%2Fhidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists%2F&#38;linkname=Hidden%20Features%20Of%20Perl%2C%20PHP%2C%20Javascript%2C%20C%2C%20C%2B%2B%2C%20C%23%2C%20Java%2C%20Ruby%2C%20Python%2C%20And%20Others%20%5BCollection%20Of%20Incredibly%20Useful%20Lists%5D">bookmark this page</a> and return to it later when the fires have...<div
class=clear></div> <a
href="http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<h2 align="left">Introduction</h2><p><a
href="http://www.stackoverflow.com">StackOverflow</a> is an amazing site for coding questions. It was created by <a
href="http://twitter.com/Spolsky" rel="nofollow">Joel Spolsky</a> of <a
href="http://joelonsoftware.com" rel="nofollow">joelonsoftware.com</a>, <a
href="http://twitter.com/codinghorror" rel="nofollow">Jeff Atwood</a> of <a
href="http://codinghorror.com" rel="nofollow">codinghorror.com</a>, and some other incredibly smart guys who truly care about user experience. I have been a total fan of SO since it went mainstream and it&#039;s now a borderline addiction (you can see my StackOverflow badge on the right sidebar).</p><h2 align="left">The Story</h2><p
align="left"><div
class="note"><div
class="noteimportant"></p><p
align="left"><strong>Update 6/21/09</strong>: This server is currently under very heavy load (10-200), even with caching plugins enabled. Please bear with me as I try to resolve the situation.</p><p
align="left">Feel free to <a
href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fbeerpla.net%2F2009%2F06%2F21%2Fhidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists%2F&amp;linkname=Hidden%20Features%20Of%20Perl%2C%20PHP%2C%20Javascript%2C%20C%2C%20C%2B%2B%2C%20C%23%2C%20Java%2C%20Ruby%2C%20Python%2C%20And%20Others%20%5BCollection%20Of%20Incredibly%20Useful%20Lists%5D">bookmark this page</a> and return to it later when the fires have been put out.</p><p
align="left"><strong>Update 06/21/09</strong>: I think I&#039;ve got the situation under control now. The load is between 0 and 3 now and pages load relatively fast. I will be posting about the getting redditted/delicioused experience later.</p><p
align="left"><strong>Update 06/23/09</strong>: Added jQuery, Greasemonkey, Ruby on Rails, and Objective-C, broke databases into their own section, and sorted everything alphabetically.</p><p
align="left"><strong>Update 06/23/09</strong>: Added Scala, Lua, TCL, F#, Regex, and HTTP.</p><p
align="left"><strong>Update 07/21/09</strong>: Added ActionScript3/Flex, Erlang, PL/SQL, Silverlight, VBA, VHDL, WPF/XAML.</p><p
align="left"><strong>Update 10/24/09</strong>: Added Flash development/language/IDE, Emacs, Xpath/Xslt, Spring framework.</p><p
align="left"><strong>Update 01/18/10</strong>: Added Android (asked by yours truly), Qt, Django, Windows.Forms, R, Lisp, x86 assembly, Grails.</p><p
align="left"></div></div></p><p>So, one day someone at StackOverflow started a &quot;Hidden features of&quot; post about a famous language (I don&#039;t feel like finding out which one was first exactly), and it turned out to be so popular that other posts in the same series started popping up.</p><p>Such questions were quickly turned into community wikis, for the purposes of harvesting and organizing information coming from the best developers on the planet and voted by users of the site. There are literally hundreds of answers, sorted by votes.</p><p><div
class="note"><div
class="notetip">The Hidden Features series is great for people who are new to a certain language. It shows the ropes and tricks, all in one place, in the most concise manner possible. Even pros oftentimes find features of their favorite language that they&#039;d never heard about.</div></div></p><h2 align="center">Hidden Features Of</h2><h3>Programming Languages</h3><h4><a
href="http://stackoverflow.com/questions/1103705/hidden-features-of-actionscript3-flex">Hidden features of ActionScript3 / Flex</a></h4><h4><a
href="http://stackoverflow.com/questions/54929/hidden-features-of-asp-net">Hidden features of ASP.NET </a></h4><h4><a
href="http://stackoverflow.com/questions/1574308/hidden-features-of-x86-assembly-language" rel="nofollow">Hidden features of x86 assembly</a></h4><h4><a
href="http://stackoverflow.com/questions/132241/hidden-features-of-c">Hidden features of C</a></h4><h4><a
href="http://stackoverflow.com/questions/75538/hidden-features-of-c">Hidden features of C++</a></h4><h4><a
href="http://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden features of C#</a></h4><h4><a
href="http://stackoverflow.com/questions/1853653/hidden-features-of-coldfusion" rel="nofollow">Hidden features of ColdFusion</a></h4><h4><a
href="http://stackoverflow.com/questions/125008/hidden-features-of-d">Hidden features of D </a></h4><h4><a
href="http://stackoverflow.com/questions/102254/hidden-features-of-delphi" rel="nofollow">Hidden features of Delphi</a></h4><h4><a
href="http://stackoverflow.com/questions/1063497/hidden-features-of-erlang" rel="nofollow">Hidden features of Erlang</a></h4><h4><a
href="http://stackoverflow.com/questions/181613/hidden-features-of-f">Hidden features of F# </a></h4><h4><a
href="http://stackoverflow.com/questions/1160680/hidden-features-tricks-of-flash-development-flash-language-as2-3-and-flash-id" rel="nofollow">Hidden features of Flash development, Flash language (AS2/3), and Flash IDE</a></h4><h4><a
href="http://stackoverflow.com/questions/15496/hidden-features-of-java">Hidden features of Java</a></h4><h4><a
href="http://stackoverflow.com/questions/61088/hidden-features-of-javascript">Hidden features of JavaScript</a></h4><h4><a
href="http://stackoverflow.com/questions/211216/hidden-features-of-haskell">Hidden features of Haskell </a></h4><h4><a
href="http://stackoverflow.com/questions/1598854/hidden-features-of-emacs-lisp" rel="nofollow">Hidden features of Lisp</a></h4><h4><a
href="http://stackoverflow.com/questions/523867/hidden-features-of-lua">Hidden features of Lua </a></h4><h4><a
href="http://stackoverflow.com/questions/211616/hidden-features-of-objective-c">Hidden features of Objective-C </a></h4><h4><a
href="http://stackoverflow.com/questions/161872/hidden-features-of-perl">Hidden features of Perl</a></h4><h4><a
href="http://stackoverflow.com/questions/61401/hidden-features-of-php">Hidden features of PHP</a></h4><h4><a
href="http://stackoverflow.com/questions/101268/hidden-features-of-python">Hidden features of Python</a></h4><h4><a
href="http://stackoverflow.com/questions/1682874/hidden-features-of-r" rel="nofollow">Hidden features of R</a></h4><h4><a
href="http://stackoverflow.com/questions/63998/hidden-features-of-ruby">Hidden features of Ruby</a></h4><h4><a
href="http://stackoverflow.com/questions/709679/hidden-features-of-ruby-on-rails">Hidden features of Ruby on Rails </a></h4><h4><a
href="http://stackoverflow.com/questions/1025181/hidden-features-of-scala">Hidden features of Scala </a></h4><h4><a
href="http://stackoverflow.com/questions/1031450/are-there-any-undocumented-features-in-silverlight">Hidden features of Silverlight</a></h4><h4><a
href="http://stackoverflow.com/questions/1596139/hidden-features-and-dark-corners-of-stl" rel="nofollow">Hidden features and Dark Corners of STL?</a></h4><h4><a
href="http://stackoverflow.com/questions/1024711/hidden-features-of-tcl-tk">Hidden features of TCL/TK</a></h4><h4><a
href="http://stackoverflow.com/questions/102084/hidden-features-of-vb-net">Hidden features of VB.Net </a></h4><h4><a
href="http://stackoverflow.com/questions/1070863/hidden-features-of-vba">Hidden features of VBA</a></h4><h3>Databases</h3><h4><a
href="http://stackoverflow.com/questions/368858/hidden-features-of-mysql">Hidden features of MySQL </a></h4><h4><a
href="http://stackoverflow.com/questions/381231/hidden-features-in-oracle">Hidden features of Oracle </a></h4><h4><a
href="http://stackoverflow.com/questions/1031485/hidden-features-of-pl-sql">Hidden features of PL/SQL</a></h4><h4><a
href="http://stackoverflow.com/questions/761327/hidden-features-of-postgresql">Hidden features of PostgreSQL </a></h4><h4><a
href="http://stackoverflow.com/questions/121243/hidden-features-of-sql-server">Hidden features of SQL Server </a></h4><h3>Mobile</h3><h4><a
href="http://stackoverflow.com/questions/1619133/hidden-features-of-android-development" rel="nofollow">Hidden features of Android development</a></h4><h3>Other</h3><h4><a
href="http://stackoverflow.com/questions/211378/hidden-features-of-bash">Hidden features of Bash</a> &#8211; also see my <a
href="http://beerpla.net/2008/12/22/mastering-the-linux-shell-bash-shortcuts-explained/">bash cheatsheet</a>.</h4><h4><a
href="http://stackoverflow.com/questions/628407/css-hidden-features">Hidden features of CSS</a></h4><h4><a
href="http://stackoverflow.com/questions/1858520/hidden-features-of-django" rel="nofollow">Hidden features of Django</a></h4><h4><a
href="http://stackoverflow.com/questions/54886/hidden-features-tricks-for-eclipse">Hidden features of Eclipse </a></h4><h4><a
href="http://stackoverflow.com/questions/1598854/hidden-features-of-emacs-lisp" rel="nofollow">Hidden features of Emacs</a></h4><h4><a
href="http://stackoverflow.com/questions/1330531/hidden-features-of-grails" rel="nofollow">Hidden features of Grails</a></h4><h4><a
href="http://stackoverflow.com/questions/121167/hidden-features-of-greasemonkey">Hidden features of Greasemonkey </a></h4><h4><a
href="http://stackoverflow.com/questions/954327/hidden-features-of-html">Hidden features of HTML </a></h4><h4><a
href="http://stackoverflow.com/questions/954894/hidden-features-of-http">Hidden features of HTTP </a></h4><h4><a
href="http://stackoverflow.com/questions/121965/hidden-or-not-widely-known-features-of-jquery">Hidden features of jQuery</a></h4><h4><a
href="http://stackoverflow.com/questions/286004/hidden-features-of-modrewrite">Hidden features of mod_rewrite </a></h4><h4><a
href="http://stackoverflow.com/questions/1826458/hidden-features-of-qt" rel="nofollow">Hidden features of Qt</a></h4><h4><a
href="http://stackoverflow.com/questions/868181/hidden-features-of-regex">Hidden features of RegEx </a></h4><h4><a
href="http://stackoverflow.com/questions/1416423/hidden-features-of-spring-framework">Hidden features of Spring framework </a></h4><h4><a
href="http://stackoverflow.com/questions/1025699/hidden-features-of-vhdl">Hidden features of VHDL</a></h4><h4><a
href="http://stackoverflow.com/questions/100420/hidden-features-of-visual-studio-2005-2008">Hidden features of Visual Studio (2005-2008) </a></h4><h4><a
href="http://stackoverflow.com/questions/1777303/hidden-features-of-windows-forms" rel="nofollow">Hidden features of Windows.Forms</a></h4><h4><a
href="http://stackoverflow.com/questions/1124769/hidden-features-of-wpf-and-xaml">Hidden features of WPF and XAML</a></h4><h4><a
href="http://stackoverflow.com/questions/1521851/hidden-features-of-xpathxslt">Hidden features of Xpath+Xslt</a></h4><p>I will try to maintain this list, adding new languages that join the series as I find them. Now go learn something new!</p><div
class='post_blob_1'>Real <a
href="http://www.test-king.com/exams/70-432.htm">70-432</a> exam preparation with help of easy to understand <a
href="http://www.test-king.com/exams/220-702.htm">220-702</a> notes and <a
href="http://www.test-king.com/exams/640-553.htm">640-553</a> practice questions.</div><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden+Features+Of+Perl%2C+PHP%2C+Javascript%2C+C%2C+C%2B%2B%2C+C%23%2C+Java%2C+Ruby%2C+Python%2C+And+Others+%5BCollection+Of+Incredibly+Useful+Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Hidden%20Features%20Of%20Perl%2C%20PHP%2C%20Javascript%2C%20C%2C%20C%2B%2B%2C%20C%23%2C%20Java%2C%20Ruby%2C%20Python%2C%20And%20Others%20%5BCollection%20Of%20Incredibly%20Useful%20Lists%5D&amp;link=http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/&amp;notes=Introduction%0D%0AStackOverflow%20is%20an%20amazing%20site%20for%20coding%20questions.%20It%20was%20created%20by%20Joel%20Spolsky%20of%20joelonsoftware.com%2C%20Jeff%20Atwood%20of%20codinghorror.com%2C%20and%20some%20other%20incredibly%20smart%20guys%20who%20truly%20care%20about%20user%20experience.%20I%20have%20been%20a%20total%20fan%20of%20SO%20since%20it%20went%20mainstream%20and%20it%27s%20now%20a&amp;short_link=http://bit.ly/capw5J&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2009/10/24/are-you-a-stackoverflow-com-superuser-com-serverfault-com-fan-heres-a-greasemonkey-script-to-keep-track-of-your-accounts-on-all-of-them/" rel="bookmark" title="October 24, 2009">StackOverflow.com, SuperUser.com, ServerFault.com Fan? Here&#039;s A Greasemonkey Script To Keep Track Of All Your Accounts</a></li><li><a
href="http://beerpla.net/2009/09/03/comparison-between-solr-and-sphinx-search-servers-solr-vs-sphinx-fight/" rel="bookmark" title="September 3, 2009">Comparison Between Solr And Sphinx Search Servers (Solr Vs Sphinx &#8211; Fight!)</a></li><li><a
href="http://beerpla.net/2009/03/17/twitter-autocomplete-auto-url-expansion-auto-url-shortener-auto-pagination-rt-button-nested-replies-inline-media-embed-search-tabs-and-more/" rel="bookmark" title="March 17, 2009">Twitter.com Autocomplete, Auto URL Expansion, Auto URL Shortener, RT Button, Nested Replies, Inline Media Embed, Search Tabs, And More</a></li><li><a
href="http://beerpla.net/2010/01/18/wordpress-developers-how-do-you-make-a-living-poll-discussion/" rel="bookmark" title="January 18, 2010">WordPress Developers &#8211; How Do You Make A Living [Poll + Discussion]?</a></li><li><a
href="http://beerpla.net/2009/08/18/delicious-com-quietly-rolls-out-domain-and-url-searchingfiltering-finally/" rel="bookmark" title="August 18, 2009">Delicious.com [Quietly] Rolls Out Domain And Url Searching/Filtering. Finally!</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2009%2F06%2F21%2Fhidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists%2F&amp;title=Hidden%20Features%20Of%20Perl%2C%20PHP%2C%20Javascript%2C%20C%2C%20C%2B%2B%2C%20C%23%2C%20Java%2C%20Ruby%2C%20Python%2C%20And%20Others%20%5BCollection%20Of%20Incredibly%20Useful%20Lists%5D" id="wpa2a_2"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/feed/</wfw:commentRss> <slash:comments>23</slash:comments> </item> <item><title>[Perl] Finding Files, The Fun And Elegant Way</title><link>http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/</link> <comments>http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/#comments</comments> <pubDate>Wed, 08 Apr 2009 14:00:00 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Awesomeness]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[efficient]]></category> <category><![CDATA[elegant]]></category> <category><![CDATA[file]]></category> <category><![CDATA[find]]></category> <category><![CDATA[follow]]></category> <category><![CDATA[fun]]></category> <category><![CDATA[robust]]></category> <category><![CDATA[search]]></category> <category><![CDATA[skip]]></category> <category><![CDATA[SVN]]></category> <category><![CDATA[symlink]]></category> <guid
isPermaLink="false">http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/</guid> <description><![CDATA[<p>No matter what programming language you use, there comes a time when you need to search for a file somewhere on the file system. Here, I want to talk about accomplishing this task in Perl. There are many ways of doing so, most of them boring, but I want to discuss the fun and elegant way &#8211; using <a
href="http://search.cpan.org/dist/File-Find-Rule/lib/File/Find/Rule.pm" rel="nofollow">File::Find::Rule</a>.</p><p>Let me briefly discuss some of the other methods first.</p><h2>Limited</h2><p>Using glob() (or &#60;&#62;, TODO verify) you can find files in a single directory, using only the limited shell wildcard support. For example,</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>my @files = glob(&#34;tmp*&#34;);</pre></td></tr></table></div><p><div
class="note"><div
class="noteclassic">I prefer glob() to &#60;&#62; because glob()&#039;s parameters can be more than just text (for ex functions) while &#60;&#62;</div></div>...<div
class=clear></div> <a
href="http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>No matter what programming language you use, there comes a time when you need to search for a file somewhere on the file system. Here, I want to talk about accomplishing this task in Perl. There are many ways of doing so, most of them boring, but I want to discuss the fun and elegant way &#8211; using <a
href="http://search.cpan.org/dist/File-Find-Rule/lib/File/Find/Rule.pm" rel="nofollow">File::Find::Rule</a>.</p><p>Let me briefly discuss some of the other methods first.</p><h2>Limited</h2><p>Using glob() (or &lt;&gt;, TODO verify) you can find files in a single directory, using only the limited shell wildcard support. For example,</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>my @files = glob(&quot;tmp*&quot;);</pre></td></tr></table></div><p><div
class="note"><div
class="noteclassic">I prefer glob() to &lt;&gt; because glob()&#039;s parameters can be more than just text (for ex functions) while &lt;&gt; treats everything inside as text.</div></div></p><h2>Boring</h2><p><a
title="http://search.cpan.org/~nwclark/perl-5.8.9/lib/File/Find.pm" href="http://search.cpan.org/~nwclark/perl-5.8.9/lib/File/Find.pm">File::Find</a> is the de facto standard for searching in Perl.</p><p>This method finds files that end in .pl in &quot;.&quot; and &quot;../SomeDir&quot;, following symlinks:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td
class="code"><pre>#!/usr/bin/perl -w
&nbsp;
use File::Find;
use Data::Dumper;
use File::Basename;
my @directories_to_search = (&quot;.&quot;, &quot;../SomeDir&quot;);
my @file_list = ();
&nbsp;
find(
  { wanted =&gt;
    sub {
      if ( basename($File::Find::name) =~ /\.pl$/i )
      {
        push @file_list, $File::Find::name;
      }
    },
    follow =&gt; 1
  },
  @directories_to_search
);
print Dumper @file_list;</pre></td></tr></table></div><p>It works fine, except it&#039;s horribly ugly and boring. Let&#039;s have a look at something more fun.</p><h2>The Fun And Elegant Way</h2><p><a
title="http://search.cpan.org/dist/File-Find-Rule/lib/File/Find/Rule.pm" href="http://search.cpan.org/dist/File-Find-Rule/lib/File/Find/Rule.pm" rel="nofollow">File::Find::Rule</a>. Just have a look at this beauty.</p><p>Just like above, find all .pl files in &quot;.&quot; and &quot;../SomeDir&quot;, following symlinks:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code"><pre>print Dumper (File::Find::Rule-&gt;name(&quot;*.pl&quot;)-&gt;file-&gt;extras({ follow =&gt; 1 })-&gt;
in(&quot;.&quot;, &quot;../SomeDir&quot;));</pre></td></tr></table></div><p>Same as above, except bypass .svn directories (shaves off a ton of time with a lot of directories):</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code"><pre>print Dumper (File::Find::Rule-&gt;not(File::Find::Rule-&gt;directory-&gt;name('.svn')-&gt;
prune-&gt;discard)-&gt;name(&quot;*.pl&quot;)-&gt;file-&gt;extras({ follow =&gt; 1 })-&gt;in(&quot;.&quot;, &quot;../SomeDir&quot;));</pre></td></tr></table></div><p>Find all .log files that are older than 24 hours in &quot;.&quot;</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre>my $epoch_time_1_day_ago = time() - 60*60*24;
print Dumper (File::Find::Rule-&gt;file-&gt;name(&quot;*.log&quot;)-&gt;
mtime(&quot;&lt;$epoch_time_1_day_ago&quot;)-&gt;in('.'));</pre></td></tr></table></div><p>Be sure to read the <a
href="http://search.cpan.org/dist/File-Find-Rule/lib/File/Find/Rule.pm" rel="nofollow">File::Find::Rule</a> perldoc for more options and remember: have fun with your code!<a
href="http://www.weblocal.ca"></a></p><p>Thanks to <a
href="http://perlbuzz.com/" rel="nofollow">Perlbuzz</a> and Andy Lester for <a
href="http://perlbuzz.com/mechanix/2008/05/optimizing-file-searches-with.html" rel="nofollow">pointing me</a> to this library a few months ago.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+Finding+Files%2C+The+Fun+And+Elegant+Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D%20Finding%20Files%2C%20The%20Fun%20And%20Elegant%20Way&amp;link=http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/&amp;notes=No%20matter%20what%20programming%20language%20you%20use%2C%20there%20comes%20a%20time%20when%20you%20need%20to%20search%20for%20a%20file%20somewhere%20on%20the%20file%20system.%20Here%2C%20I%20want%20to%20talk%20about%20accomplishing%20this%20task%20in%20Perl.%20There%20are%20many%20ways%20of%20doing%20so%2C%20most%20of%20them%20boring%2C%20but%20I%20want%20to%20discuss%20the%20fun%20and%20elegant%20way%20-%20using%20Fil&amp;short_link=http://bit.ly/caZusS&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/" rel="bookmark" title="March 5, 2009">[Perl] How To Get The Path Of An Included Library (.pm), Regardless Of Current Directory</a></li><li><a
href="http://beerpla.net/2007/10/28/ftprush-cleanup-script/" rel="bookmark" title="October 28, 2007">FTPRush Cleanup Script</a></li><li><a
href="http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/" rel="bookmark" title="March 21, 2008">Quick Perl Snippet: Finding If A File Has A Media Extension Using Regex</a></li><li><a
href="http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/" rel="bookmark" title="July 23, 2008">How To Check If The Local SVN Revision Is Up-To-Date</a></li><li><a
href="http://beerpla.net/2008/10/11/how-to-sort-folders-the-same-way-as-files-in-total-commander/" rel="bookmark" title="October 11, 2008">How To Sort Folders The Same Way As Files In Total Commander</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2009%2F04%2F08%2Fperl-finding-files-the-fun-and-elegant-way%2F&amp;title=%5BPerl%5D%20Finding%20Files%2C%20The%20Fun%20And%20Elegant%20Way" id="wpa2a_4"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>[Perl] How To Get The Path Of An Included Library (.pm), Regardless Of Current Directory</title><link>http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/</link> <comments>http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/#comments</comments> <pubDate>Fri, 06 Mar 2009 05:41:02 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[dir]]></category> <category><![CDATA[directory]]></category> <category><![CDATA[INC]]></category> <category><![CDATA[include]]></category> <category><![CDATA[library]]></category> <category><![CDATA[path]]></category> <category><![CDATA[script]]></category> <guid
isPermaLink="false">http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/</guid> <description><![CDATA[<h2>Problem</h2><p>While writing a 1093985th Perl script the other day I was facing the following dilemma:</p><ul><li>Let’s say there is a local library, called <em>TheUberLib.pm</em>. It is so uber that most of my scripts, located all over the machine, include it.</li><li>Now, let’s also say that there’s an even more uberly important binary called <em>run_me_now_or_you_will_die</em> but the only way to find it is by using a relative path to the aforementioned <em>TheUberLib.pm</em>, for example <em>../bin</em> (RELATIVE TO <em>TheUberLib.pm)</em>.</li><li>I don’t want to hardcode the path to <em>run_me_now_or_you_will_die </em>because it can be different on multiple machines and the code wouldn’t be robust enough – all I know is that the path is relative to an included library.</li></ul><p>...<div
class=clear></div> <a
href="http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<h2>Problem</h2><p>While writing a 1093985th Perl script the other day I was facing the following dilemma:</p><ul><li>Let’s say there is a local library, called <em>TheUberLib.pm</em>. It is so uber that most of my scripts, located all over the machine, include it.</li><li>Now, let’s also say that there’s an even more uberly important binary called <em>run_me_now_or_you_will_die</em> but the only way to find it is by using a relative path to the aforementioned <em>TheUberLib.pm</em>, for example <em>../bin</em> (RELATIVE TO <em>TheUberLib.pm)</em>.</li><li>I don’t want to hardcode the path to <em>run_me_now_or_you_will_die </em>because it can be different on multiple machines and the code wouldn’t be robust enough – all I know is that the path is relative to an included library.</li></ul><p>So how does one get the path to an included <em>TheUberLib.pm </em>(in my case to deduce the path to <em>run_me_now_or_you_will_die</em>),<em> </em>regardless of the script location and the current directory?</p><p>I started looking at all possible ways of getting this information.</p><ul><li>At first I looked at $0. $0 returns the path to the Perl script itself (<em>LibraryPath/lib_path.pl</em>) and is completely useless here.</li><li>The <em>FindBin </em>module that I sometimes use was also of no help as it also deals with the caller script path.</li></ul><h2>Solution</h2><p>After digging around for a bit, this is the method I came up with that did exactly what I wanted:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code"><pre>use File::Basename;
my $path_to_uber_lib = dirname($INC{'TheUberLib.pm'});</pre></td></tr></table></div><p>and the clean way to get the final path to <em>run_me_now_or_you_will_die</em> is:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre>my $relative_path_to_bin_dir = &quot;../the_path_we_want/run_me_now_or_you_will_die&quot;;
my $path_to_deadly_bin = Cwd::realpath(&quot;$path_to_uber_lib/$relative_path_to_bin_dir&quot;);
print &quot;The path to deadly bin is: $path_to_deadly_bin\n&quot;;</pre></td></tr></table></div><p>which prints <em>/tmp/LibraryPath/some_path1/the_path_we_want/run_me_now_or_you_will_die.</em></p><p>Here is the full program with all directories that you can check out from SVN:</p><div
class="wp_syntax"><div
class="code"><pre>svn co http://beerpla.net/svn/public/Perl/LibraryPath/</pre></div></div><p>or just browse the code here: <a
href="http://beerpla.net/svn/public/Perl/LibraryPath/">http://beerpla.net/svn/public/Perl/LibraryPath/</a></p><h2>Explanation</h2><p>The <em>%INC</em> hash contains all included libraries, with library names as keys and full paths as values.</p><p>The <em>dirname()</em> function is part of <a
href="http://perldoc.perl.org/File/Basename.html" rel="nofollow">File::Basename</a><em></em> and returns just the directory part of the path.</p><p>Finally, <a
href="http://perldoc.perl.org/Cwd.html" rel="nofollow">Cwd::realpath()</a><em></em> is a function that resolves relative and symbolic links to canonical absolute ones.</p><p>And there you have it.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D+How+To+Get+The+Path+Of+An+Included+Library+%28.pm%29%2C+Regardless+Of+Current+Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=%5BPerl%5D%20How%20To%20Get%20The%20Path%20Of%20An%20Included%20Library%20%28.pm%29%2C%20Regardless%20Of%20Current%20Directory&amp;link=http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/&amp;notes=Problem%20%20While%20writing%20a%201093985th%20Perl%20script%20the%20other%20day%20I%20was%20facing%20the%20following%20dilemma%3A%20%20%20%20%20Let%E2%80%99s%20say%20there%20is%20a%20local%20library%2C%20called%20TheUberLib.pm.%20It%20is%20so%20uber%20that%20most%20of%20my%20scripts%2C%20located%20all%20over%20the%20machine%2C%20include%20it.%20%20%20%20%20Now%2C%20let%E2%80%99s%20also%20say%20that%20there%E2%80%99s%20an%20even%20more%20uber&amp;short_link=http://bit.ly/cVf4Vf&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2007/10/28/ftprush-cleanup-script/" rel="bookmark" title="October 28, 2007">FTPRush Cleanup Script</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li><li><a
href="http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/" rel="bookmark" title="April 8, 2009">[Perl] Finding Files, The Fun And Elegant Way</a></li><li><a
href="http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/" rel="bookmark" title="March 27, 2008">Parsing JSON In Perl By Example &#8211; SouthParkStudios.com South Park Episodes</a></li><li><a
href="http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/" rel="bookmark" title="January 13, 2010">[WordPress Plugin Development] How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2009%2F03%2F05%2Fperl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory%2F&amp;title=%5BPerl%5D%20How%20To%20Get%20The%20Path%20Of%20An%20Included%20Library%20%28.pm%29%2C%20Regardless%20Of%20Current%20Directory" id="wpa2a_6"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Programming Comics: xkcd &#8211; 11th-Grade Activities</title><link>http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/</link> <comments>http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/#comments</comments> <pubDate>Fri, 19 Dec 2008 08:47:16 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Humor]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[xkcd]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/12/19/xkcd-11th-grade-activities/</guid> <description><![CDATA[<p>Hey, I can relate to today’s <a
href="http://xkcd.com">xkcd</a>! It hits close to home:</p><p><a
href="http://xkcd.com/519/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="333" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image.png" width="535" /></a></p><p>&#160;</p><p>And some more traveling down the Perl related memory lane (yeah, these are old, I know):</p><p><a
href="http://xkcd.com/224/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="194" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image_3.png" width="653" /></a>&#160;</p><p><a
href="http://xkcd.com/208/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="607" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image_4.png" width="600" /></a></p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&#38;service=7&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=5&#38;tags=&#38;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=257&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=40&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=202&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=2&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=38&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Programming%20Comics%3A%20xkcd%20-%2011th-Grade%20Activities&#38;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&#38;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&#38;short_link=http://bit.ly/9AahNQ&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=201&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/" rel="bookmark" title="March 17, 2008">Programming Comic: Lisp, Perl, And God</a></li><li><a
href="http://beerpla.net/2008/09/01/hug-a-developer-day/" rel="bookmark" title="September 1, 2008">Hug A Developer Day</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li><li><a
href="http://beerpla.net/2007/11/11/got-drinks/" rel="bookmark" title="November 11, 2007">Got Drinks?</a></li><li><a
href="http://beerpla.net/2010/11/06/how-to-dynamically-increase-memory-limits-when-interfacing-with-wordpress-using-xml-rpc-windows-live-writer-etc/" rel="bookmark" title="November 6, 2010">How To Dynamically Increase Memory Limits When Interfacing With WordPress Using XML-RPC (Windows Live Writer, Etc)</a></li></ul>]]></description> <content:encoded><![CDATA[<p>Hey, I can relate to today’s <a
href="http://xkcd.com">xkcd</a>! It hits close to home:</p><p><a
href="http://xkcd.com/519/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="333" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image.png" width="535" /></a></p><p>&#160;</p><p>And some more traveling down the Perl related memory lane (yeah, these are old, I know):</p><p><a
href="http://xkcd.com/224/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="194" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image_3.png" width="653" /></a>&#160;</p><p><a
href="http://xkcd.com/208/"><img
title="image" style="display: block; float: none; margin: 0px auto 10px" height="607" alt="image" src="http://beerpla.net/wp-content/uploads/xkcd11thGradeActivities_96D/image_4.png" width="600" /></a></p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comics%3A+xkcd+-+11th-Grade+Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Programming%20Comics%3A%20xkcd%20-%2011th-Grade%20Activities&amp;link=http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/&amp;notes=Hey%2C%20I%20can%20relate%20to%20today%E2%80%99s%20xkcd%21%20It%20hits%20close%20to%20home%3A%20%20%20%20%26%23160%3B%20%20And%20some%20more%20traveling%20down%20the%20Perl%20related%20memory%20lane%20%28yeah%2C%20these%20are%20old%2C%20I%20know%29%3A%20%20%26%23160%3B%20%20&amp;short_link=http://bit.ly/9AahNQ&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/" rel="bookmark" title="March 17, 2008">Programming Comic: Lisp, Perl, And God</a></li><li><a
href="http://beerpla.net/2008/09/01/hug-a-developer-day/" rel="bookmark" title="September 1, 2008">Hug A Developer Day</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li><li><a
href="http://beerpla.net/2007/11/11/got-drinks/" rel="bookmark" title="November 11, 2007">Got Drinks?</a></li><li><a
href="http://beerpla.net/2010/11/06/how-to-dynamically-increase-memory-limits-when-interfacing-with-wordpress-using-xml-rpc-windows-live-writer-etc/" rel="bookmark" title="November 6, 2010">How To Dynamically Increase Memory Limits When Interfacing With WordPress Using XML-RPC (Windows Live Writer, Etc)</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F12%2F19%2Fprogramming-comics-xkcd-11th-grade-activities%2F&amp;title=Programming%20Comics%3A%20xkcd%20%26%238211%3B%2011th-Grade%20Activities" id="wpa2a_8"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>My Notes On Learning Python Coming From Perl</title><link>http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/</link> <comments>http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/#comments</comments> <pubDate>Fri, 10 Oct 2008 02:13:34 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[experiences]]></category> <category><![CDATA[learning]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[Python]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/</guid> <description><![CDATA[<blockquote><p><a
href="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_3.png" class="lightview" rel="gallery['441']" title="image"><img
title="image" style="display: inline; margin: 0px 20px 10px 0px" height="71" alt="image" src="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_thumb_3.png" width="211" align="left" /></a></p></blockquote><p>I’m learning Python. Since I’m currently primarily a Perl coder, I decided it’d be a good idea to post and keep track of my experiences coming from heavy Perl. I have a few reasons for learning Python, which are:</p><ul><li>to see what else is out there and broaden my horizons.</li><li>to keep my brain active by feeding it new tasty information every day.</li><li>to become a more valuable employee and potential future candidate.</li><li>to learn a new language, especially one used by giants like Google.</li><li>to learn a new OO language, as I’m tired of Perl’s hacky OO.</li><li>to build GUI applications. GUI in Perl is a big pain. I’ll see about</li></ul><p>...<div
class=clear></div> <a
href="http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<blockquote><p><a
href="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_3.png" class="lightview" rel="gallery['441']" title="image"><img
title="image" style="display: inline; margin: 0px 20px 10px 0px" height="71" alt="image" src="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_thumb_3.png" width="211" align="left" /></a></p></blockquote><p>I’m learning Python. Since I’m currently primarily a Perl coder, I decided it’d be a good idea to post and keep track of my experiences coming from heavy Perl. I have a few reasons for learning Python, which are:</p><ul><li>to see what else is out there and broaden my horizons.</li><li>to keep my brain active by feeding it new tasty information every day.</li><li>to become a more valuable employee and potential future candidate.</li><li>to learn a new language, especially one used by giants like Google.</li><li>to learn a new OO language, as I’m tired of Perl’s hacky OO.</li><li>to build GUI applications. GUI in Perl is a big pain. I’ll see about Python.</li></ul><p>So, without further ado, here are the notes [WORK IN PROGRESS], split by virtual chapters that I made up myself:</p><p><strong>Chapter 1.</strong></p><ul><li>I’m using <a
href="http://www.eclipse.org">Eclipse</a> for most of my development. <a
href="http://e-p-i-c.sourceforge.net/">E.P.I.C.</a> is the plugin that adds Perl support and it works quite well. For Python, I downloaded the Python plugin called <a
href="http://pydev.sf.net">Pydev</a>. It seems to work quite well as well. The only thing so far I wouldn’t use Eclipse for is PHP because PHPEd trumps all competition (though there’s an Eclipse PHP plugin called <a
href="http://www.phpeclipse.de">PHPEclipse</a>). A quick way to see the plugins you have installed just click Help-&gt;About.</li></ul><p><a
href="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_5.png" class="lightview" rel="gallery['441']" title="image"><img
title="image" style="display: block; float: none; margin-left: auto; margin-right: auto" height="309" alt="image" src="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_thumb_5.png" width="537" /></a></p><ul><li>Tuples are just immutable lists? a = (‘b’, ‘c’) is immutable while a = [‘b’, ‘c'] is just what a regular list in Perl is. I’m not sure what to make of it yet and whether it was worth it giving up such important syntax as () for that.</li><li>I hate ActiveState’s PythonWin console (the editor itself). Ctrl-Up for history and regular Up for traveling around the code? WTF? Though I do like that there are intellisense-like features in it.</li><li>I miss the $, @, %, etc in front of variables. It’s so easy to tell what is a variable and what is not, what type a variable is, as well as insert it right inside quotes.</li><li>I began to understand how many things in Perl I took for granted.</li><li>A hash is called a dictionary in Python (created with { } ). Hash keys are separated from values via “:” instead of Perl’s “=&gt;”. For example, dict = {“a” : “b”, “c” : “d”}. In Perl “=&gt;” and “,” are the same, but in Python “:” and “,” are very different and cannot be used interchangeably.</li><li>At this point I really like the OO feel of typing in a dictionary name, followed by a dot and getting a list of class methods as opposed to Perl’s non-OO approach. Since I’ve been looking to get back into a more OO language than Perl but not as OO as Java, I think Python may be the right fit. We’ll see…</li></ul><p><a
href="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_4.png" class="lightview" rel="gallery['441']" title="image"><img
title="image" style="display: block; float: none; margin-left: auto; margin-right: auto" height="154" alt="image" src="http://beerpla.net/wp-content/uploads/MyNotesOnLearningPythonComingFromPerl_10E56/image_thumb_4.png" width="418" /></a></p><ul><li>Now the book (Wrox Beginning Python) mentions the dict.__contains__() function, which looks internal to me. Why did they not instead use the dict.has_key() function? They look like they do exactly the same thing. Why did they start from functions that are supposed to be hidden in the first place?</li><li>There are special values <em>True</em>, <em>False</em>, and <em>None</em>, which correspond to <em>1</em>, <em>0</em>, and <em>undef </em>(?) in Perl.</li><li>list.remove(VAL) function looks useful. I don’t think Perl has anything like it. It removes the first occurrence of value VAL in list.</li><li>If you list.append() another list, it appends a sub-list object, while list.extend() actually extends the list with another list. In Perl list.append() would correspond to pushing an array ref and list.extend() would be pushing an array itself.</li><li>You can compare 2 sequences (lists, tuples, dictionaries) with ==, just like numbers. In Perl, if you try @a == @b, only array lengths will be compared.</li><li>string concatenation is done via “+” vs Perl’s “.”.<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>str_final = str1 + &quot; &quot; + str2</pre></td></tr></table></div></li><li>The <em>print</em> function has a couple of quirks in Python. <em>print</em> implicitly outputs a space between expressions, and it also implicitly outputs \n after the last expression, unless the last expression is followed by a trailing comma (,).<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code"><pre>print &quot;hi&quot;, &quot;I'm&quot;,
print &quot;still on the same line&quot;, &quot;but will end the line now&quot;</pre></td></tr></table></div></li><li>Variable substitution is separated from the print statement by “%” for some reason, compared to Perls’ “,”.<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>print &quot;some string: %s&quot; % str1</pre></td></tr></table></div></li><li>One can do something like<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>a, b, c = x</pre></td></tr></table></div><p>if x is a sequence of 3 items. This would assign a, b, and cy to the items of x, respectively. In Perl, similarly, you could do</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>($a, $b, $c) = @x</pre></td></tr></table></div></li><li>A shortcut for string repetition is<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>print str1 * 10</pre></td></tr></table></div><p>vs Perl&#039;s</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>print $str1 x 10</pre></td></tr></table></div></li></ul><p><strong>Chapter 2.</strong></p><ul><li>Here we go: conditional statements <em>if</em>, <em>elif</em>, and <em>else</em>. This is what I’ve been waiting for – as there are no braces needed around conditional statements, loops, etc, indentation plays the role of controlling context. But for *****s sake, PHP has <em>elseif</em>, Perl has <em>elsif</em>, now <em>elif</em>? What’s next, eif? Anyway, a conditional statement is followed by a “:” and then an indented block of lines.</li><li>I like how I don’t need to put parentheses after <em>if</em>. This is similar to Perl’s notation where <em>if </em>comes after the main statement. However, parentheses are mandatory otherwise in Perl.</li><li>Loops have <em>while</em> and <em>for</em>. <strike>Where’s <em>foreach</em>? (panic… noooooooooooooooooooooooo!!! Perl spoiled me.)</strike> Actually, I was wrong. It’s exactly the opposite – Python’s <em>for</em> is exactly like Perl’s <em>foreach</em> (thanks Travis!). Rather, Python doesn’t have the c-style <em>for</em>. To break out of a loop, <em>break</em> is used (phew, at least this is expected) vs Perl’s <em>last</em> and to continue, <em>continue</em> is used vs Perl’s <em>next</em>.</li><li>Oh, so back to indentation again. Any inconsistent indentation is accompanied by an <em>IndentationError</em> (<em>Inconsistent dedent</em> in Pydev Eclipse) compile time error. I think I like this rule in general, because it encourages proper white space in the code but I have not decided yet. This makes me kind of worried – what if some code gets slightly scrambled and some spaces get lost, for example copy-pasting from a random Internet site or if my blog code displaying tools lose indentation. In Eclipse, a simple Ctrl-Shift-F, which runs Perltidy, can fix any indentation problems and inconsistencies. I don’t know Python, I don’t know…</li><li>This is interesting: a loop can have an <em>else</em> statement. If the loop does not end via <em>break</em>, the else statement triggers. I could see this usage for example: if I’m TODOlooking for something in a hash, you can break the else statement can print “Not found” and act on it.</li><li>Slicing multiple consecutive values in lists is done via “:” rather than Perl’s “..”. Compare list[1:3] vs Perl’s @list[1..3]. . What&#039;s interesting is an optional 3rd parameter to the slice, which specifies a stride. Thus, list[::2] would produce a sequence with items that have an even index in list and list[::-1] would reverse the list. Quite handy and original.</li><li>if no action is performed by something that requires a level of indentation (for example, an <em>if</em> statement that does nothing), a special keyword <em>pass </em>needs to be used. In Perl, it would just be an empty set of parentheses.<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code"><pre>if some_event_that_needs_no_action:
  pass
else:
  # do stuff</pre></td></tr></table></div></li></ul><p><strong>Chapter 3.</strong></p><ul><li>Python seems to have proper exception handling support. A breath of fresh air from Perl’s hacky evals. Try with <em>try</em>, catch with <em>except</em>, and finally with <em>finally</em>. What is the generic Error name that you can use to catch all errors?</li><li>One can raise an error by using a <em>raise</em> keyword.</li></ul><p><strong>Chapter 4.</strong></p><ul><li>Functions are defined using the <em>def</em> keyword, as opposed to Perl’s <em>sub</em>.</li><li>Function documentation (docstring) is simply a string that follows the function definition. It is what intellisense-enabled IDEs use (and probably some sort of python documenters). This information is also available as <em>function_name.__doc__</em>. I really like this as I think Perl’s POD style is hideous. I’ll have to see how powerful this docstring can get, because perlpod, though hideous, supports a variety of formatting options.</li><li><em>dir(object)</em> shows all properties of <em>object</em>. I’m guessing this is another way intellisense IDEs get the information to show a user. For example,<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre>&gt;&gt;&gt; dir(my_func)
['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name']</pre></td></tr></table></div></li><li>A function can have default parameters, similar to PHP. Perl 5 doesn’t have such construct, it’s only introduced in <a
href="http://beerpla.net/2008/08/22/moving-from-perl-5-to-perl-6-whats-new-tutorial-style/">Perl 6</a>. For example<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>def do_search(string, start = &quot;.&quot;):</pre></td></tr></table></div></li><li>A function can be defined within another function and will only be available in the latter’s scope. I am fairly sure Perl allows you to do the same, though I see this functionality as very insignificant.</li><li>type() allows one to determine the type of a variable. For instance, to see if a variable is a dictionary<div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>if type(dict) == type({}):</pre></td></tr></table></div></li></ul><p><strong>Chapter 5.</strong></p><ul><li>A class is defined using a keyword <em>class</em> vs Perl’s <em>package</em>. Talking about Perl’s class implementation causes vomiting reaction in me, and I’m really hoping Python’s is better. Python is supposed to be a proper OO language and that is partly why I’m learning it. However, one thing is upsettingly common between Python and Perl and that is <em>self</em> in Python and <em>$self</em> in Perl are the first parameters in class member functions, rather than being implied, like in C++ or PHP. So one has to write def add(self, num_list) rather than def add(num_list). Is it because Python is so OO to the bone that it has to have everything declared and nothing implied?</li><li>At first sight, a few things are kind of upsetting actually. The examples in the book don’t define member variables – they just assign them outside of the class definition. Whaaaat? How is this different from Perl then?</li><li>A function is public by default. To make a function private, one needs to prefix it with __. However, if it also ends with __, it’s not private&#160; but instead just considered internal (kind of like hidden but not really). An internal function is technically supposed to be used by member methods only but nothing prevents anyone outside the class definition to call it (see the __contains__() example in chapter 1). That’s a bit ambiguous to say the least but still better than Perl’s hacks related to private functions.</li><li>Python doesn’t support protected functions.</li><li>At this point I’m starting to read <a
href="http://www.amazon.com/dp/0596100469/?tag=beepla-20">O’Reilly Python In A Nutshell</a> in parallel with <a
href="http://www.amazon.com/dp/0764596543/?tag=beepla-20">Wrox Beginning Python</a> that I’ve been reading so far. It is much more concise and to the point. Wrox assumes I’m a total noob, even beyond noob. I highly recommend the O’Reilly book.</li></ul><p>&#160;</p><p>&#160;</p><p>[WORK IN PROGRESS]</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=My+Notes+On+Learning+Python+Coming+From+Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=My%20Notes%20On%20Learning%20Python%20Coming%20From%20Perl&amp;link=http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/&amp;notes=%20%20%20%20%20%20I%E2%80%99m%20learning%20Python.%20Since%20I%E2%80%99m%20currently%20primarily%20a%20Perl%20coder%2C%20I%20decided%20it%E2%80%99d%20be%20a%20good%20idea%20to%20post%20and%20keep%20track%20of%20my%20experiences%20coming%20from%20heavy%20Perl.%20I%20have%20a%20few%20reasons%20for%20learning%20Python%2C%20which%20are%3A%20%20%20%20%20to%20see%20what%20else%20is%20out%20there%20and%20broaden%20my%20horizons.%20%20%20%20%20to%20keep%20my%20b&amp;short_link=http://bit.ly/cx7tx6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/12/16/the-ultimate-programming-language-lolcode/" rel="bookmark" title="December 16, 2008">The Ultimate Programming Language &#8211; LOLCODE</a></li><li><a
href="http://beerpla.net/2009/11/04/android-auto-formatting-android-xml-files-with-eclipse/" rel="bookmark" title="November 4, 2009">[Android] Auto Formatting Android XML Files With Eclipse</a></li><li><a
href="http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/" rel="bookmark" title="March 21, 2008">Quick Perl Snippet: Finding If A File Has A Media Extension Using Regex</a></li><li><a
href="http://beerpla.net/2008/08/22/moving-from-perl-5-to-perl-6-whats-new-tutorial-style/" rel="bookmark" title="August 22, 2008">Moving From Perl 5 to Perl 6 &#8211; What&#039;s New, Tutorial Style</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F10%2F09%2Fmy-notes-on-learning-python-coming-from-perl%2F&amp;title=My%20Notes%20On%20Learning%20Python%20Coming%20From%20Perl" id="wpa2a_10"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/10/09/my-notes-on-learning-python-coming-from-perl/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>How To Install The Latest SOAP::Lite Using Perl CPAN</title><link>http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/</link> <comments>http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/#comments</comments> <pubDate>Wed, 30 Apr 2008 17:56:53 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[cpan]]></category> <category><![CDATA[install]]></category> <category><![CDATA[installation]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[SOAP]]></category> <category><![CDATA[SOAP::Lite]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/</guid> <description><![CDATA[<p>Apparently it&#039;s not straightforward to install SOAP::Lite, even using CPAN.</p><p>Check this out.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td
class="code"><pre>cpan[1]&#62; install SOAP::Lite
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
  Database was generated on Tue, 29 Apr 2008 18:29:45 GMT
CPAN: YAML loaded ok (v0.66)
Going to read /root/.cpan/build/
............................................................................DONE
Found 149 old builds, restored the state of 109
Warning: Cannot install SOAP::Lite, don't know what it is.
Try the command
&#160;
    i /SOAP::Lite/
&#160;
to find objects with matching identifiers.
CPAN: Time::HiRes loaded ok (v1.9713)</pre></td></tr></table></div><p>Huh? Okay&#8230;</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td
class="code"><pre>cpan[2]&#62; i /SOAP::Lite/
Module</pre></td></tr></table></div><p>...<div
class=clear></div> <a
href="http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>Apparently it&#039;s not straightforward to install SOAP::Lite, even using CPAN.</p><p>Check this out.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td
class="code"><pre>cpan[1]&gt; install SOAP::Lite
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
  Database was generated on Tue, 29 Apr 2008 18:29:45 GMT
CPAN: YAML loaded ok (v0.66)
Going to read /root/.cpan/build/
............................................................................DONE
Found 149 old builds, restored the state of 109
Warning: Cannot install SOAP::Lite, don't know what it is.
Try the command
&nbsp;
    i /SOAP::Lite/
&nbsp;
to find objects with matching identifiers.
CPAN: Time::HiRes loaded ok (v1.9713)</pre></td></tr></table></div><p>Huh? Okay&#8230;</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td
class="code"><pre>cpan[2]&gt; i /SOAP::Lite/
Module    ResourcePool::Command::SOAP::Lite::Call (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module    ResourcePool::Factory::SOAP::Lite (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module    ResourcePool::Resource::SOAP::Lite (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module    SOAP::Lite::Deserializer::XMLSchema1999 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::Deserializer::XMLSchema2001 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::Deserializer::XMLSchemaSOAP1_1 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::Deserializer::XMLSchemaSOAP1_2 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::InstanceExporter (SMEISNER/SOAP-Lite-InstanceExporter-0.02.tar.gz)
Module    SOAP::Lite::Packager   (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::Simple     (LLAP/SOAP-Lite-Simple-1.9.tar.gz)
Module    SOAP::Lite::Simple::DotNet (LLAP/SOAP-Lite-Simple-1.4.tar.gz)
Module    SOAP::Lite::Simple::Real (LLAP/SOAP-Lite-Simple-1.4.tar.gz)
Module    SOAP::Lite::Utility    (BRYCE/SOAP-Lite-Utility-0.01.tar.gz)
Module    SOAP::Lite::Utils      (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
14 items found</pre></td></tr></table></div><p>Wtf? Let&#039;s try something else.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td
class="code"><pre>cpan[8]&gt; i /SOAP.*Lite/
Distribution    BRYCE/SOAP-Lite-Utility-0.01.tar.gz
Distribution    BYRNE/SOAP/SOAP-Lite-0.60a.tar.gz
Distribution    DYACOB/SOAP-Lite-ActiveWorks-0.10.tar.gz
Distribution    DYACOB/SOAP-Lite-SmartProxy-0.11.tar.gz
Distribution    LLAP/SOAP-Lite-Simple-1.4.tar.gz
Distribution    LLAP/SOAP-Lite-Simple-1.9.tar.gz
Distribution    MKUTTER/SOAP-Lite-0.71.04.tar.gz
Distribution    MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz
Distribution    SMEISNER/SOAP-Lite-InstanceExporter-0.02.tar.gz
Module    Catalyst::Action::SOAP::DocumentLiteral (DRUOSO/Catalyst-Controller-SOAP-0.8.tar.gz)
Module    Catalyst::Action::SOAP::DocumentLiteralWrapped (DRUOSO/Catalyst-Controller-SOAP-0.8.tar.gz)
Module    Catalyst::Action::SOAP::RPCLiteral (DRUOSO/Catalyst-Controller-SOAP-0.8.tar.gz)
Module    Catalyst::Controller::SOAP::DocumentLiteralWrapped (DRUOSO/Catalyst-Controller-SOAP-0.8.tar.gz)
Module    Net::DRI::Transport::HTTP::SOAPLite (PMEVZEK/Net-DRI-0.85.tar.gz)
Module    ResourcePool::Command::SOAP::Lite::Call (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module    ResourcePool::Factory::SOAP::Lite (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module    ResourcePool::Resource::SOAP::Lite (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)
Module  = SOAP::Lite::Deserializer::XMLSchema1999 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module  = SOAP::Lite::Deserializer::XMLSchema2001 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module  = SOAP::Lite::Deserializer::XMLSchemaSOAP1_1 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module  = SOAP::Lite::Deserializer::XMLSchemaSOAP1_2 (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::InstanceExporter (SMEISNER/SOAP-Lite-InstanceExporter-0.02.tar.gz)
Module  = SOAP::Lite::Packager   (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
Module    SOAP::Lite::Simple     (LLAP/SOAP-Lite-Simple-1.9.tar.gz)
Module    SOAP::Lite::Simple::DotNet (LLAP/SOAP-Lite-Simple-1.4.tar.gz)
Module    SOAP::Lite::Simple::Real (LLAP/SOAP-Lite-Simple-1.4.tar.gz)
Module    SOAP::Lite::Utility    (BRYCE/SOAP-Lite-Utility-0.01.tar.gz)
Module  = SOAP::Lite::Utils      (MKUTTER/SOAP-Lite-0.71.04.tar.gz)
28 items found</pre></td></tr></table></div><p>Aha! It&#039;s hiding under a Distribution. Tricky, tricky.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code"><pre>cpan
install MKUTTER/SOAP-Lite-0.71.04.tar.gz</pre></td></tr></table></div><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre></td><td
class="code"><pre>  CPAN.pm: Going to build M/MK/MKUTTER/SOAP-Lite-0.71.04.tar.gz
&nbsp;
We are about to install SOAP::Lite and for your convenience will provide
you with list of modules and prerequisites, so you'll be able to choose
only modules you need for your configuration.
&nbsp;
XMLRPC::Lite, UDDI::Lite, and XML::Parser::Lite are included by default.
Installed transports can be used for both SOAP::Lite and XMLRPC::Lite.
&nbsp;
Press  to see the detailed list.
&nbsp;
Feature                       Prerequisites                Install?
----------------------------- ---------------------------- --------
Core Package                  [*] Scalar::Util             always
                              [*] Test::More
                              [*] URI
                              [*] MIME::Base64
                              [*] version
                              [*] XML::Parser (v2.23)
Client HTTP support           [*] LWP::UserAgent           always
Client HTTPS support          [*] Crypt::SSLeay            [ yes ]
Client SMTP/sendmail support  [ ] MIME::Lite               [ no ]
Client FTP support            [*] IO::File                 [ yes ]
                              [*] Net::FTP
Standalone HTTP server        [*] HTTP::Daemon             [ yes ]
Apache/mod_perl server        [ ] Apache                   [ no ]
FastCGI server                [ ] FCGI                     [ no ]
POP3 server                   [*] MIME::Parser             [ yes ]
                              [*] Net::POP3
IO server                     [*] IO::File                 [ yes ]
MQ transport support          [ ] MQSeries                 [ no ]
JABBER transport support      [ ] Net::Jabber              [ no ]
MIME messages                 [*] MIME::Parser             [ yes ]
DIME messages                 [*] IO::Scalar (v2.105)      [ no ]
                              [ ] DIME::Tools (v0.03)
                              [ ] Data::UUID (v0.11)
SSL Support for TCP Transport [ ] IO::Socket::SSL          [ no ]
Compression support for HTTP  [*] Compress::Zlib           [ yes ]
MIME interoperability w/ Axis [ ] MIME::Parser (v6.106)    [ no ]
--- An asterix '[*]' indicates if the module is currently installed.
&nbsp;
Do you want to proceed with this configuration? [yes]
Checking if your kit is complete...
Looks good
Writing Makefile for SOAP::Lite
cp lib/SOAP/Packager.pm blib/lib/SOAP/Packager.pm
cp lib/XML/Parser/Lite.pm blib/lib/XML/Parser/Lite.pm
...
Writing /usr/lib/perl5/site_perl/5.10.0/i686-linux/auto/SOAP/Lite/.packlist
Appending installation info to /usr/lib/perl5/5.10.0/i686-linux/perllocal.pod
  MKUTTER/SOAP-Lite-0.71.04.tar.gz
  /usr/bin/make install  -- OK</pre></td></tr></table></div><p>The latest version of SOAP::Lite is installed, time to pat yourself on the back and write some code to actually use it.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Install+The+Latest+SOAP%3A%3ALite+Using+Perl+CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=How%20To%20Install%20The%20Latest%20SOAP%3A%3ALite%20Using%20Perl%20CPAN&amp;link=http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/&amp;notes=Apparently%20it%27s%20not%20straightforward%20to%20install%20SOAP%3A%3ALite%2C%20even%20using%20CPAN.%20Check%20this%20out.%20cpan%5B1%5D%3E%20install%20SOAP%3A%3ALite%0ACPAN%3A%20Storable%20loaded%20ok%20%28v2.18%29%0AGoing%20to%20read%20%2Froot%2F.cpan%2FMetadata%0A%20%20Database%20was%20generated%20on%20Tue%2C%2029%20Apr%202008%2018%3A29%3A45%20GMT%0ACPAN%3A%20YAML%20loaded%20ok%20%28v0.66%29%0AGoing%20to%20read%20%2Froot%2F.cpan&amp;short_link=http://bit.ly/dcTX3j&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/" rel="bookmark" title="October 12, 2007">cpan &#8211; The Perl Module Manager</a></li><li><a
href="http://beerpla.net/2009/06/09/how-to-make-your-site-lightning-fast-by-compressing-deflategzip-your-html-javascript-css-xml-etc-in-apache/" rel="bookmark" title="June 9, 2009">How To Make Your Site Lightning Fast* By Compressing (deflate/gzip) Your HTML, Javascript, CSS, XML, etc In Apache</a></li><li><a
href="http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/" rel="bookmark" title="April 22, 2008">Do NOT Use This Perl Module: Passwd::Unix</a></li><li><a
href="http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/" rel="bookmark" title="March 27, 2008">Parsing JSON In Perl By Example &#8211; SouthParkStudios.com South Park Episodes</a></li><li><a
href="http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/" rel="bookmark" title="February 3, 2010">How *Not* To Implement A Web Application That Handles External Authentication, Using BeTwittered.com As An Example</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F04%2F30%2Fhow-to-install-the-latest-soaplite-using-perl-cpan%2F&amp;title=How%20To%20Install%20The%20Latest%20SOAP%3A%3ALite%20Using%20Perl%20CPAN" id="wpa2a_12"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</title><link>http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/</link> <comments>http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/#comments</comments> <pubDate>Wed, 30 Apr 2008 01:52:28 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Perl]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[annoying]]></category> <category><![CDATA[backtick]]></category> <category><![CDATA[child]]></category> <category><![CDATA[error code]]></category> <category><![CDATA[perl 5.10]]></category> <category><![CDATA[perldelta]]></category> <category><![CDATA[perlrun]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[return value]]></category> <category><![CDATA[system]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/</guid> <description><![CDATA[<p>I&#039;m sure most Perl coders have to face this annoying problem at one point or another: how do you consistently get the return value out of a system call, be at executed via backticks or system()? Backticks return the output of the program with no error code in sight, while system() returns the error code but prints the output instead of putting it into a variable.</p><p>The best solution I could find to this problem to date was posted at <a
title="http://www.perlmonks.org/?node_id=19119" href="http://www.perlmonks.org/?node_id=19119">http://www.perlmonks.org/?node_id=19119</a> and involved opening a piped filehandle. It worked quite well but always felt like a hack (which it was). Having used the new <a
href="http://dev.perl.org/perl5/news/2007/perl-5.10.0.html">Perl 5.10</a> for a few months, I was shocked today to find this...<div
class=clear></div> <a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>I&#039;m sure most Perl coders have to face this annoying problem at one point or another: how do you consistently get the return value out of a system call, be at executed via backticks or system()? Backticks return the output of the program with no error code in sight, while system() returns the error code but prints the output instead of putting it into a variable.</p><p>The best solution I could find to this problem to date was posted at <a
title="http://www.perlmonks.org/?node_id=19119" href="http://www.perlmonks.org/?node_id=19119">http://www.perlmonks.org/?node_id=19119</a> and involved opening a piped filehandle. It worked quite well but always felt like a hack (which it was). Having used the new <a
href="http://dev.perl.org/perl5/news/2007/perl-5.10.0.html">Perl 5.10</a> for a few months, I was shocked today to find this new variable that I&#039;ve been dreaming about for years:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>${^CHILD_ERROR_NATIVE}</pre></td></tr></table></div><p>This variable gives the native status returned by the last pipe close, <strong>backtick command</strong>, successful call to wait() or waitpid(), or from the <strong>system()</strong> operator. See perlrun for details. (Contributed by Gisle Aas.)</p><p><a
href="http://search.cpan.org/dist/perl-5.10.0/pod/perl5100delta.pod#New_internal_variables">http://search.cpan.org/dist/perl-5.10.0/pod/perl5100delta.pod#New_internal_variables</a></p><p>I&#039;ve just tested it and it works as described. Finally!.. what else can I say?</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=How+Do+I+Get+Both+The+Return+Value+And+Text+In+Perl%3F+Backticks+vs.+System%28%29+%28Perl+5.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=How%20Do%20I%20Get%20Both%20The%20Return%20Value%20And%20Text%20In%20Perl%3F%20Backticks%20vs.%20System%28%29%20%28Perl%205.10%29&amp;link=http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/&amp;notes=I%27m%20sure%20most%20Perl%20coders%20have%20to%20face%20this%20annoying%20problem%20at%20one%20point%20or%20another%3A%20how%20do%20you%20consistently%20get%20the%20return%20value%20out%20of%20a%20system%20call%2C%20be%20at%20executed%20via%20backticks%20or%20system%28%29%3F%20Backticks%20return%20the%20output%20of%20the%20program%20with%20no%20error%20code%20in%20sight%2C%20while%20system%28%29%20returns%20the%20error%20&amp;short_link=http://bit.ly/a8k2E6&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/" rel="bookmark" title="June 10, 2010">How To Display Just The HTTP Response Code In Command Line Curl</a></li><li><a
href="http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/" rel="bookmark" title="July 23, 2008">How To Check If The Local SVN Revision Is Up-To-Date</a></li><li><a
href="http://beerpla.net/2008/04/16/mysql-conference-liveblogging-monitoring-tools-wednesday-515pm/" rel="bookmark" title="April 16, 2008">MySQL Conference Liveblogging: Monitoring Tools (Wednesday 5:15PM)</a></li><li><a
href="http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/" rel="bookmark" title="March 5, 2009">[Perl] How To Get The Path Of An Included Library (.pm), Regardless Of Current Directory</a></li><li><a
href="http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/" rel="bookmark" title="August 4, 2007">Watch &#8211; A Useful Linux Command You May Have Never Heard Of</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F04%2F29%2Fhow-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510%2F&amp;title=How%20Do%20I%20Get%20Both%20The%20Return%20Value%20And%20Text%20In%20Perl%3F%20Backticks%20vs.%20System%28%29%20%28Perl%205.10%29" id="wpa2a_14"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Do NOT Use This Perl Module: Passwd::Unix</title><link>http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/</link> <comments>http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/#comments</comments> <pubDate>Wed, 23 Apr 2008 03:05:29 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[module]]></category> <category><![CDATA[passwd]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[shadow]]></category> <category><![CDATA[unix]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/</guid> <description><![CDATA[<p><strong>Update:</strong> The author of the module contacted me the same day and promised to fix it in the next version. Version 0.40 was indeed on cpan as promised, but I haven&#039;t tested it yet.</p><p><a
href="http://search.cpan.org/~strzelec/Passwd-Unix-0.33/Unix.pm">Passwd::Unix</a> will corrupt your /etc/shadow file and rearrange login names and their corresponding password hashes.</p><p>The current version of Passwd::Unix corrupted my /etc/shadow upon only<br
/> calling the passwd() function. Immediately users started to report not<br
/> being able to login.</p><p>After examining the situation, I found that Passwd::Unix rearranges all<br
/> users in /etc/shadow in some way, but it only does it to the<br
/> usernames, and not the password hashes. Thus, you will get corrupted accounts. Moreover,<br
/> users are now able to login...<div
class=clear></div> <a
href="http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p><strong>Update:</strong> The author of the module contacted me the same day and promised to fix it in the next version. Version 0.40 was indeed on cpan as promised, but I haven&#039;t tested it yet.</p><p><a
href="http://search.cpan.org/~strzelec/Passwd-Unix-0.33/Unix.pm">Passwd::Unix</a> will corrupt your /etc/shadow file and rearrange login names and their corresponding password hashes.</p><p>The current version of Passwd::Unix corrupted my /etc/shadow upon only<br
/> calling the passwd() function. Immediately users started to report not<br
/> being able to login.</p><p>After examining the situation, I found that Passwd::Unix rearranges all<br
/> users in /etc/shadow in some way, but it only does it to the<br
/> usernames, and not the password hashes. Thus, you will get corrupted accounts. Moreover,<br
/> users are now able to login to one OTHER account, not their own,<br
/> depending on how the usernames got shuffled.</p><p>Thankfully, I had a recent backup but I definitely don’t want anyone<br
/> else to suffer.</p><p>I’m using perl 5.10, SUSE 10.3. If it’s incompatible with SUSE, it needs<br
/> to say so and exit.</p><p>I&#039;ve filed the bug here: <a
title="http://rt.cpan.org/Public/Bug/Display.html?id=35323" href="http://rt.cpan.org/Public/Bug/Display.html?id=35323">http://rt.cpan.org/Public/Bug/Display.html?id=35323</a>.</p><p>You have been warned.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Do+NOT+Use+This+Perl+Module%3A+Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Do%20NOT%20Use%20This%20Perl%20Module%3A%20Passwd%3A%3AUnix&amp;link=http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/&amp;notes=Update%3A%20The%20author%20of%20the%20module%20contacted%20me%20the%20same%20day%20and%20promised%20to%20fix%20it%20in%20the%20next%20version.%20Version%200.40%20was%20indeed%20on%20cpan%20as%20promised%2C%20but%20I%20haven%27t%20tested%20it%20yet.%0D%0A%0D%0APasswd%3A%3AUnix%20will%20corrupt%20your%20%2Fetc%2Fshadow%20file%20and%20rearrange%20login%20names%20and%20their%20corresponding%20password%20hashes.%0D%0A%0D%0ATh&amp;short_link=http://bit.ly/cNzTKm&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/" rel="bookmark" title="February 3, 2010">How *Not* To Implement A Web Application That Handles External Authentication, Using BeTwittered.com As An Example</a></li><li><a
href="http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/" rel="bookmark" title="October 12, 2007">cpan &#8211; The Perl Module Manager</a></li><li><a
href="http://beerpla.net/2008/05/12/a-better-diff-or-what-to-do-when-gnu-diff-runs-out-of-memory-diff-memory-exhausted/" rel="bookmark" title="May 12, 2008">A Better diff Or What To Do When GNU diff Runs Out Of Memory (&quot;diff: memory exhausted&quot;)</a></li><li><a
href="http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/" rel="bookmark" title="April 30, 2008">How To Install The Latest SOAP::Lite Using Perl CPAN</a></li><li><a
href="http://beerpla.net/2008/04/16/mysql-conference-liveblogging-mysql-performance-under-a-microscope-the-tobias-and-jay-show-wednesday-200pm/" rel="bookmark" title="April 16, 2008">MySQL Conference Liveblogging: MySQL Performance Under A Microscope: The Tobias And Jay Show (Wednesday 2:00PM)</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F04%2F22%2Fdo-not-use-this-perl-module-passwdunix%2F&amp;title=Do%20NOT%20Use%20This%20Perl%20Module%3A%20Passwd%3A%3AUnix" id="wpa2a_16"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Parsing JSON In Perl By Example &#8211; SouthParkStudios.com South Park Episodes</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/</link> <comments>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comments</comments> <pubDate>Thu, 27 Mar 2008 16:51:36 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[json]]></category> <category><![CDATA[parse]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[south park]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/</guid> <description><![CDATA[<p>In this tutorial, I&#039;ll show you how to parse <a
href="http://search.cpan.org/dist/JSON/">JSON</a> using Perl. As a fun example, I&#039;ll use the new <a
href="http://www.southparkstudios.com">SouthParkStudios.com</a> site released earlier this week, which contains full legal episodes of South Park. I guess the TV companies are finally getting a clue about what users want.</p><p>I will parse the first season&#039;s JSON and pull out information about individual episodes (like title, description, air date, etc) from <a
href="http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1">http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1</a>. Feel free to replace &#039;1&#039; with any valid season number.</p><p>Here&#039;s a short snippet of the JSON:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29</pre></td></tr></table></div><p>...<div
class=clear></div> <a
href="http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>In this tutorial, I&#039;ll show you how to parse <a
href="http://search.cpan.org/dist/JSON/">JSON</a> using Perl. As a fun example, I&#039;ll use the new <a
href="http://www.southparkstudios.com">SouthParkStudios.com</a> site released earlier this week, which contains full legal episodes of South Park. I guess the TV companies are finally getting a clue about what users want.</p><p>I will parse the first season&#039;s JSON and pull out information about individual episodes (like title, description, air date, etc) from <a
href="http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1">http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1</a>. Feel free to replace &#039;1&#039; with any valid season number.</p><p>Here&#039;s a short snippet of the JSON:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td
class="code"><pre>{
season:{
&nbsp;
episode:[
&nbsp;
{
title:'Cartman Gets an Anal Probe',
description:'While the boys are waiting for the school bus, Cartman explains the odd nightmare he had the previous night involving alien visitors.',
thumbnail:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e01_480.jpg&amp;width=55&amp;quality=100',
thumbnail_larger:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e01_480.jpg&amp;width=63&amp;quality=100',
thumbnail_190:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e01_480.jpg&amp;width=190&amp;quality=100',
id:'103511',
airdate:'08.13.97',
episodenumber:'101',
available:'true',
when:'08.13.97'
}
&nbsp;
,
&nbsp;
{
title:'Weight Gain 4000',
description:'When Cartman\'s environmental essay wins a national contest, America\'s sweetheart, Kathie Lee Gifford, comes to South Park to present the award.',
thumbnail:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e02_480.jpg&amp;width=55&amp;quality=100',
thumbnail_larger:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e02_480.jpg&amp;width=63&amp;quality=100',
thumbnail_190:'http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e02_480.jpg&amp;width=190&amp;quality=100',
id:'103516',
airdate:'08.20.97',
episodenumber:'102',
available:'true',
when:'08.20.97'
}
&nbsp;
...
&nbsp;
]
}
}</pre></td></tr></table></div><p> <br
/>Before you can parse JSON, you need to have a few libraries. Install them using CPAN, for example:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code"><pre>cpan
install JSON
install JSON::XS
install WWW::Mechanize # my favorite library for browsing</pre></td></tr></table></div><p>Now <a
href="http://beerpla.net/svn/public/Perl/Parsing.JSON/southpark.json.pl">the script</a>.</p><p></p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td
class="code"><pre>#!/usr/bin/perl -w
# $Rev: 11 $
# $Author: artem $
# $Date: 2009-05-23 23:09:47 -0700 (Sat, 23 May 2009) $
&nbsp;
use strict;
use WWW::Mechanize;
use JSON -support_by_pp;
&nbsp;
fetch_json_page(&quot;http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1&quot;);
&nbsp;
sub fetch_json_page
{
  my ($json_url) = @_;
  my $browser = WWW::Mechanize-&gt;new();
  eval{
    # download the json page:
    print &quot;Getting json $json_url\n&quot;;
    $browser-&gt;get( $json_url );
    my $content = $browser-&gt;content();
    my $json = new JSON;
&nbsp;
    # these are some nice json options to relax restrictions a bit:
    my $json_text = $json-&gt;allow_nonref-&gt;utf8-&gt;relaxed-&gt;escape_slash-&gt;loose-&gt;allow_singlequote-&gt;allow_barekey-&gt;decode($content);
&nbsp;
    # iterate over each episode in the JSON structure:
    my $episode_num = 1;
    foreach my $episode(@{$json_text-&gt;{season}-&gt;{episode}}){
      my %ep_hash = ();
      $ep_hash{title} = &quot;Episode $episode_num: $episode-&gt;{title}&quot;;
      $ep_hash{description} = $episode-&gt;{description};
      $ep_hash{url} = &quot;http://www.southparkstudios.com/episodes/&quot; . $episode-&gt;{id};
      $ep_hash{publish_date} = $episode-&gt;{airdate};
      $ep_hash{thumbnail_url} = $episode-&gt;{thumbnail_190} || $episode-&gt;{thumbnail_larger};
&nbsp;
      # print episode information:
      while (my($k, $v) = each (%ep_hash)){
        print &quot;$k =&gt; $v\n&quot;;
      }
      print &quot;\n&quot;;
&nbsp;
      $episode_num++;
    }
  };
  # catch crashes:
  if($@){
    print &quot;[[JSON ERROR]] JSON parser crashed! $@\n&quot;;
  }
}</pre></td></tr></table></div><p>Here&#039;s the output:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td
class="code"><pre>Getting json http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1
publish_date =&gt; 08.13.97
url =&gt; http://www.southparkstudios.com/episodes/103511
thumbnail_url =&gt; http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e01_480.jpg&amp;width=190&amp;quality=100
title =&gt; Episode 1: Cartman Gets an Anal Probe
description =&gt; While the boys are waiting for the school bus, Cartman explains the odd nightmare he had the previous night involving alien visitors.
&nbsp;
publish_date =&gt; 08.20.97
url =&gt; http://www.southparkstudios.com/episodes/103516
thumbnail_url =&gt; http://www.southparkstudios.com/includes/utils/proxy_resizer.php?image=/images/south_park/episode_thumbnails/s01e02_480.jpg&amp;width=190&amp;quality=100
title =&gt; Episode 2: Weight Gain 4000
description =&gt; When Cartman's environmental essay wins a national contest, America's sweetheart, Kathie Lee Gifford, comes to South Park to present the award.
&nbsp;
...</pre></td></tr></table></div><p>Of particular interest here is the way JSON accepts settings:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre>my $json_text = $json-&gt;allow_nonref-&gt;utf8-&gt;relaxed-&gt;escape_slash-&gt;loose-&gt;allow_singlequote-&gt;allow_barekey-&gt;decode($content);</pre></td></tr></table></div><p>I found that these settings fix most of the crashes and incompatibilities while parsing various JSON pages.</p><p>Is there something I&#039;ve missed? Do you know a better way to parse JSON in Perl? Unclear about something. Don&#039;t hesitate to share in the comments.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing+JSON+In+Perl+By+Example+-+SouthParkStudios.com+South+Park+Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Parsing%20JSON%20In%20Perl%20By%20Example%20-%20SouthParkStudios.com%20South%20Park%20Episodes&amp;link=http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/&amp;notes=In%20this%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20parse%20JSON%20using%20Perl.%20As%20a%20fun%20example%2C%20I%27ll%20use%20the%20new%20SouthParkStudios.com%20site%20released%20earlier%20this%20week%2C%20which%20contains%20full%20legal%20episodes%20of%20South%20Park.%20I%20guess%20the%20TV%20companies%20are%20finally%20getting%20a%20clue%20about%20what%20users%20want.%20%20I%20will%20parse%20the%20first%20&amp;short_link=http://bit.ly/5mOJwd&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2010/01/12/are-your-youtube-video-embeds-missing-the-full-screen-button-here-is-how-to-fix-it/" rel="bookmark" title="January 12, 2010">Are Your Youtube Video Embeds Missing The Full Screen Button? Here Is How To Fix It</a></li><li><a
href="http://beerpla.net/2010/01/09/the-easiest-and-best-way-to-search-for-beautiful-wallpapers-in-your-specific-screen-resolution-and-size/" rel="bookmark" title="January 9, 2010">The Easiest (And Best?) Way To Search For Beautiful Wallpapers In Your Specific Screen Resolution And Size</a></li><li><a
href="http://beerpla.net/2006/08/19/prison-break-season-2-returns-august-21st/" rel="bookmark" title="August 19, 2006">Prison Break &#8211; Season 2 Returns August 21st!</a></li><li><a
href="http://beerpla.net/2010/01/15/follow-up-to-loading-css-and-js-conditionally/" rel="bookmark" title="January 15, 2010">Follow-up To Loading CSS And JS Conditionally</a></li><li><a
href="http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/" rel="bookmark" title="August 4, 2007">Watch &#8211; A Useful Linux Command You May Have Never Heard Of</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F03%2F27%2Fparsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes%2F&amp;title=Parsing%20JSON%20In%20Perl%20By%20Example%20%26%238211%3B%20SouthParkStudios.com%20South%20Park%20Episodes" id="wpa2a_18"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/feed/</wfw:commentRss> <slash:comments>21</slash:comments> </item> <item><title>Quick Perl Snippet: Finding If A File Has A Media Extension Using Regex</title><link>http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/</link> <comments>http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/#comments</comments> <pubDate>Fri, 21 Mar 2008 21:11:34 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[extension]]></category> <category><![CDATA[file]]></category> <category><![CDATA[media]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[regex]]></category> <category><![CDATA[regexp]]></category> <category><![CDATA[type]]></category> <category><![CDATA[url]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/</guid> <description><![CDATA[<p>Sometimes in my line of work, I need to figure out if a url or filename point to a media file by checking for the file extension. If it&#039;s a url, however, it may be followed by various parameters. Not to overcomplicate things, I came up with the following Perl code:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td
class="code"><pre>#!/usr/bin/perl -w
use strict;
my $name = &#34;some_file.flv&#34;; # or http://example.com/file.mp4?foo=bar
my $is_media_type = ($name =~ /\.(wmv&#124;avi&#124;flv&#124;mov&#124;mkv&#124;mp..?&#124;swf&#124;ra.?&#124;rm&#124;as.&#124;m4[av]&#124;smi.?)\b/i);
if($is_media_type){
  print &#34;media extension found\n&#34;;
}
else{
  print &#34;not a media file\n&#34;;
}</pre></td></tr></table></div><p>This gets the job done without triggering any false positives (at least for the files/urls I&#039;ve been dealing with so far). Am I missing any obvious types? Do...<div
class=clear></div> <a
href="http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>Sometimes in my line of work, I need to figure out if a url or filename point to a media file by checking for the file extension. If it&#039;s a url, however, it may be followed by various parameters. Not to overcomplicate things, I came up with the following Perl code:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td
class="code"><pre>#!/usr/bin/perl -w
use strict;
my $name = &quot;some_file.flv&quot;; # or http://example.com/file.mp4?foo=bar
my $is_media_type = ($name =~ /\.(wmv|avi|flv|mov|mkv|mp..?|swf|ra.?|rm|as.|m4[av]|smi.?)\b/i);
if($is_media_type){
  print &quot;media extension found\n&quot;;
}
else{
  print &quot;not a media file\n&quot;;
}</pre></td></tr></table></div><p>This gets the job done without triggering any false positives (at least for the files/urls I&#039;ve been dealing with so far). Am I missing any obvious types? Do you have a better way to accomplish the same thing? If so, please share in the comments.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Quick+Perl+Snippet%3A+Finding+If+A+File+Has+A+Media+Extension+Using+Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Quick%20Perl%20Snippet%3A%20Finding%20If%20A%20File%20Has%20A%20Media%20Extension%20Using%20Regex&amp;link=http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/&amp;notes=Sometimes%20in%20my%20line%20of%20work%2C%20I%20need%20to%20figure%20out%20if%20a%20url%20or%20filename%20point%20to%20a%20media%20file%20by%20checking%20for%20the%20file%20extension.%20If%20it%27s%20a%20url%2C%20however%2C%20it%20may%20be%20followed%20by%20various%20parameters.%20Not%20to%20overcomplicate%20things%2C%20I%20came%20up%20with%20the%20following%20Perl%20code%3A%0A%0A%23%21%2Fusr%2Fbin%2Fperl%20-w%0Ause%20strict%3B%0Amy&amp;short_link=http://bit.ly/cMBVAD&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2009/04/08/perl-finding-files-the-fun-and-elegant-way/" rel="bookmark" title="April 8, 2009">[Perl] Finding Files, The Fun And Elegant Way</a></li><li><a
href="http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/" rel="bookmark" title="August 4, 2007">Watch &#8211; A Useful Linux Command You May Have Never Heard Of</a></li><li><a
href="http://beerpla.net/2009/03/17/twitter-autocomplete-auto-url-expansion-auto-url-shortener-auto-pagination-rt-button-nested-replies-inline-media-embed-search-tabs-and-more/" rel="bookmark" title="March 17, 2009">Twitter.com Autocomplete, Auto URL Expansion, Auto URL Shortener, RT Button, Nested Replies, Inline Media Embed, Search Tabs, And More</a></li><li><a
href="http://beerpla.net/2008/04/26/how-to-list-files-within-tgz-targz-archives/" rel="bookmark" title="April 26, 2008">How To List Files Within tgz (tar.gz) Archives</a></li><li><a
href="http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/" rel="bookmark" title="January 13, 2010">[WordPress Plugin Development] How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F03%2F21%2Fquick-snippet-finding-if-a-file-has-a-media-extension-using-regex%2F&amp;title=Quick%20Perl%20Snippet%3A%20Finding%20If%20A%20File%20Has%20A%20Media%20Extension%20Using%20Regex" id="wpa2a_20"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/03/21/quick-snippet-finding-if-a-file-has-a-media-extension-using-regex/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Programming Comic: Lisp, Perl, And God</title><link>http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/</link> <comments>http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/#comments</comments> <pubDate>Tue, 18 Mar 2008 06:33:21 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Humor]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[comic]]></category> <category><![CDATA[god]]></category> <category><![CDATA[lisp]]></category> <category><![CDATA[Perl]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/</guid> <description><![CDATA[<p>Computer Science majors out there that went through tedious hours of studying <a
href="http://en.wikipedia.org/wiki/Lisp_programming_language">Lisp</a> &#8211; this is for you from <a
href="http://www.xkcd.com">xkcd</a>. If you know Perl, it will make even more sense.</p><p
align="center"><a
href="http://beerpla.net/wp-content/uploads/ProgrammingComicLispPerlAndGod_14A79/image.png" class="lightview" rel="gallery['291']"><img
alt="image" src="http://beerpla.net/wp-content/uploads/ProgrammingComicLispPerlAndGod_14A79/image_thumb.png" width="640" height="190" /></a></p><p>Source: <a
title="http://xkcd.com/224/" href="http://xkcd.com/224/">http://xkcd.com/224/</a></p><p>See Also: <a
title="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/" href="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/">Best Programming Comic Ever: Code Quality In WTFs/Minute</a></p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&#38;service=7&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=5&#38;tags=&#38;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=257&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=40&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=202&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=2&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=38&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Programming%20Comic%3A%20Lisp%2C%20Perl%2C%20And%20God&#38;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&#38;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&#38;short_link=http://bit.ly/93yIB9&#38;v=1&#38;apitype=1&#38;apikey=8afa39428933be41f8afdb8ea21a495c&#38;source=Shareaholic&#38;template=&#38;service=201&#38;tags=&#38;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/" rel="bookmark" title="March 12, 2008">Best Programming Comic Ever: Code Quality In WTFs/Minute</a></li><li><a
href="http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/" rel="bookmark" title="December 19, 2008">Programming Comics: xkcd &#8211; 11th-Grade Activities</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li><li><a
href="http://beerpla.net/2007/10/28/ftprush-cleanup-script/" rel="bookmark" title="October 28, 2007">FTPRush Cleanup Script</a></li><li><a
href="http://beerpla.net/2008/12/16/the-ultimate-programming-language-lolcode/" rel="bookmark" title="December 16, 2008">The Ultimate Programming Language &#8211; LOLCODE</a></li></ul>]]></description> <content:encoded><![CDATA[<p>Computer Science majors out there that went through tedious hours of studying <a
href="http://en.wikipedia.org/wiki/Lisp_programming_language">Lisp</a> &#8211; this is for you from <a
href="http://www.xkcd.com">xkcd</a>. If you know Perl, it will make even more sense.</p><p
align="center"><a
href="http://beerpla.net/wp-content/uploads/ProgrammingComicLispPerlAndGod_14A79/image.png" class="lightview" rel="gallery['291']"><img
alt="image" src="http://beerpla.net/wp-content/uploads/ProgrammingComicLispPerlAndGod_14A79/image_thumb.png" width="640" height="190" /></a></p><p>Source: <a
title="http://xkcd.com/224/" href="http://xkcd.com/224/">http://xkcd.com/224/</a></p><p>See Also: <a
title="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/" href="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/">Best Programming Comic Ever: Code Quality In WTFs/Minute</a></p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Programming+Comic%3A+Lisp%2C+Perl%2C+And+God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Programming%20Comic%3A%20Lisp%2C%20Perl%2C%20And%20God&amp;link=http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/&amp;notes=Computer%20Science%20majors%20out%20there%20that%20went%20through%20tedious%20hours%20of%20studying%20Lisp%20-%20this%20is%20for%20you%20from%20xkcd.%20If%20you%20know%20Perl%2C%20it%20will%20make%20even%20more%20sense.%20%20%20%20%20Source%3A%20http%3A%2F%2Fxkcd.com%2F224%2F%20%20See%20Also%3A%20Best%20Programming%20Comic%20Ever%3A%20Code%20Quality%20In%20WTFs%2FMinute&amp;short_link=http://bit.ly/93yIB9&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/03/12/best-programming-comic-ever-code-quality-in-wtfsminute/" rel="bookmark" title="March 12, 2008">Best Programming Comic Ever: Code Quality In WTFs/Minute</a></li><li><a
href="http://beerpla.net/2008/12/19/programming-comics-xkcd-11th-grade-activities/" rel="bookmark" title="December 19, 2008">Programming Comics: xkcd &#8211; 11th-Grade Activities</a></li><li><a
href="http://beerpla.net/2008/04/29/how-do-i-get-both-the-return-value-and-text-in-perl-backticks-vs-system-perl-510/" rel="bookmark" title="April 29, 2008">How Do I Get Both The Return Value And Text In Perl? Backticks vs. System() (Perl 5.10)</a></li><li><a
href="http://beerpla.net/2007/10/28/ftprush-cleanup-script/" rel="bookmark" title="October 28, 2007">FTPRush Cleanup Script</a></li><li><a
href="http://beerpla.net/2008/12/16/the-ultimate-programming-language-lolcode/" rel="bookmark" title="December 16, 2008">The Ultimate Programming Language &#8211; LOLCODE</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F03%2F17%2Fprogramming-comic-lisp-perl-and-god%2F&amp;title=Programming%20Comic%3A%20Lisp%2C%20Perl%2C%20And%20God" id="wpa2a_22"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/03/17/programming-comic-lisp-perl-and-god/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>cpan &#8211; The Perl Module Manager</title><link>http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/</link> <comments>http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/#comments</comments> <pubDate>Sat, 13 Oct 2007 00:24:22 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[cpan]]></category> <category><![CDATA[make]]></category> <category><![CDATA[module]]></category> <category><![CDATA[Perl]]></category> <category><![CDATA[suse]]></category> <guid
isPermaLink="false">http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/</guid> <description><![CDATA[<p>cpan is a perl module manager. To get into cpan, login as root and type in</p><div
class="wp_syntax"><div
class="code"><pre>cpan</pre></div></div><p>Install a module:</p><div
class="wp_syntax"><div
class="code"><pre>cpan install MODULE</pre></div></div><p>Upgrade a module:</p><div
class="wp_syntax"><div
class="code"><pre>cpan upgrade MODULE</pre></div></div><p>Reinstall a module or force install in case of failed tests:</p><div
class="wp_syntax"><div
class="code"><pre>force install MODULE</pre></div></div><p>See a list of upgradable modules:</p><div
class="wp_syntax"><div
class="code"><pre>r</pre></div></div><p>See cpan configuration (that&#039;s the letter &#039;o&#039;):</p><div
class="wp_syntax"><div
class="code"><pre>o conf</pre></div></div><p>Update an option in cpan configuration:</p><div
class="wp_syntax"><div
class="code"><pre>o conf OPTION_NAME OPTION_VALUE</pre></div></div><p>It is always nice to:</p><div
class="wp_syntax"><div
class="code"><pre>upgrade CPAN
install Bundle::CPAN</pre></div></div><p>If there&#039;s an error making a Perl module, it can be caused by a missing make path in cpan configuration. In cpan, type in:</p><div
class="wp_syntax"><div
class="code"><pre>o conf</pre></div></div><p>which will show all cpan options, then:...<div
class=clear></div> <a
href="http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>cpan is a perl module manager. To get into cpan, login as root and type in</p><div
class="wp_syntax"><div
class="code"><pre>cpan</pre></div></div><p>Install a module:</p><div
class="wp_syntax"><div
class="code"><pre>cpan install MODULE</pre></div></div><p>Upgrade a module:</p><div
class="wp_syntax"><div
class="code"><pre>cpan upgrade MODULE</pre></div></div><p>Reinstall a module or force install in case of failed tests:</p><div
class="wp_syntax"><div
class="code"><pre>force install MODULE</pre></div></div><p>See a list of upgradable modules:</p><div
class="wp_syntax"><div
class="code"><pre>r</pre></div></div><p>See cpan configuration (that&#039;s the letter &#039;o&#039;):</p><div
class="wp_syntax"><div
class="code"><pre>o conf</pre></div></div><p>Update an option in cpan configuration:</p><div
class="wp_syntax"><div
class="code"><pre>o conf OPTION_NAME OPTION_VALUE</pre></div></div><p>It is always nice to:</p><div
class="wp_syntax"><div
class="code"><pre>upgrade CPAN
install Bundle::CPAN</pre></div></div><p>If there&#039;s an error making a Perl module, it can be caused by a missing make path in cpan configuration. In cpan, type in:</p><div
class="wp_syntax"><div
class="code"><pre>o conf</pre></div></div><p>which will show all cpan options, then:</p><div
class="wp_syntax"><div
class="code"><pre>o conf make /usr/bin/make
o conf commit</pre></div></div><p>A good option is:</p><div
class="wp_syntax"><div
class="code"><pre>o conf prerequisites_policy follow</pre></div></div><p>By default, cpan will prompt to install every dependecy while installing a module. This option will automatically install dependencies without prompting.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=cpan+-+The+Perl+Module+Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=cpan%20-%20The%20Perl%20Module%20Manager&amp;link=http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/&amp;notes=cpan%20is%20a%20perl%20module%20manager.%20To%20get%20into%20cpan%2C%20login%20as%20root%20and%20type%20in%0D%0Acpan%0D%0AInstall%20a%20module%3A%0D%0Acpan%20install%20MODULE%0D%0AUpgrade%20a%20module%3A%0D%0Acpan%20upgrade%20MODULE%0D%0AReinstall%20a%20module%20or%20force%20install%20in%20case%20of%20failed%20tests%3A%0D%0Aforce%20install%20MODULE%0D%0ASee%20a%20list%20of%20upgradable%20modules%3A%0D%0Ar%0D%0ASee%20cpan%20configu&amp;short_link=http://bit.ly/9bgziz&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2008/04/30/how-to-install-the-latest-soaplite-using-perl-cpan/" rel="bookmark" title="April 30, 2008">How To Install The Latest SOAP::Lite Using Perl CPAN</a></li><li><a
href="http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/" rel="bookmark" title="April 22, 2008">Do NOT Use This Perl Module: Passwd::Unix</a></li><li><a
href="http://beerpla.net/2009/06/09/how-to-make-your-site-lightning-fast-by-compressing-deflategzip-your-html-javascript-css-xml-etc-in-apache/" rel="bookmark" title="June 9, 2009">How To Make Your Site Lightning Fast* By Compressing (deflate/gzip) Your HTML, Javascript, CSS, XML, etc In Apache</a></li><li><a
href="http://beerpla.net/2009/03/05/perl-how-to-get-the-path-of-an-included-library-pm-regardless-of-current-directory/" rel="bookmark" title="March 5, 2009">[Perl] How To Get The Path Of An Included Library (.pm), Regardless Of Current Directory</a></li><li><a
href="http://beerpla.net/2007/07/09/how-to-download-and-install-windows-media-player-11-bypassing-wga/" rel="bookmark" title="July 9, 2007">How To Download And Install Windows Media Player 11 Bypassing WGA</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2007%2F10%2F12%2Fcpan-the-perl-module-manager%2F&amp;title=cpan%20%26%238211%3B%20The%20Perl%20Module%20Manager" id="wpa2a_24"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2007/10/12/cpan-the-perl-module-manager/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
