tomhukins's Friends' Journals http://use.perl.org/~tomhukins/journal/friends/ tomhukins's Friends' use Perl Journals en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:14:56+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 tomhukins's Friends' Journals http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~tomhukins/journal/friends/ Why do I blog? http://use.perl.org/~redspike/journal/40513?from=rss Last week I posted a thingy on <a href="http://use.perl.org/~redspike/journal/40499">use.perl.org </a> which is my first blog for a while. Today I recalled the blog and how I had got there. It is interesting following links when idly browsing. This was my path:- <ul> <li>Tom Hukins from mk.pm posted a link to <a href="http://www.presentingperl.org/ye2010/">YAPC::EU videos</a> </li><li>I watched the video by <a href="http://www.presentingperl.org/ye2010/perl-community/">Dave Cross on the Perl community</a> </li><li>He mentioned <a href="http://ironman.enlightenedperl.org/">Ironman</a></li> <li>I then watched most of the videos on <a href="http://www.presentingperl.org/">presentingperl.org</a>. Another productive afternoon.</li><li>I felt the urge to blog.</li></ul><p>I blogged</p><p>Perhaps the more interesting thing is why I did not blog for such a long time. That question has not really been answered yet. In this respect I have failed. I do not keep up any other blog other than this one at the moment, so it was not as though I was blogged out.</p><p>Another case of the missing cheese and scullery maid.</p> redspike 2010-08-24T21:23:44+00:00 journal Flore Louise Apolline Bruhat-Souche http://use.perl.org/~BooK/journal/40510?from=rss <p>On Thursday, August 19, 2010 at 9:30, Flore Louise Apolline Bruhat-Souche was born. She weighs 3.02 kg and measures 48 cm. </p><p> Word already spread through IRC (#perlfr and #yapc mostly) and via email and telephone. </p><p> The mother is fine, the father is slightly tired and the <a href="http://use.perl.org/~BooK/journal/33509">big sister</a> is happy. </p><p> There is <a href="http://flore.bruhat-souche.net/">one photo online</a>. </p> BooK 2010-08-20T22:17:07+00:00 journal Will parrot be the last one standing? http://use.perl.org/~nicholas/journal/40509?from=rss <p>I'm a bit behind the times here, but I read today that one of the two remaining developers of IronRuby has left Microsoft:</p><blockquote><div><p>Overall, I see a serious lack of commitment to IronRuby, and dynamic language on<nobr> <wbr></nobr>.NET in general. At the time of my leaving Tomas and myself were the only Microsoft employees working on IronRuby.</p></div></blockquote><p> <a href="http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html">http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.ht<nobr>m<wbr></nobr> l</a>*</p><p>So if Microsoft's interest in dynamic languages is wilting, and Oracle's litigation scares everyone away from Java, will that leave <a href="http://parrot.org/">Parrot</a> as the last one standing?</p><p> <small>* yep, that's a formatting bug. I assume that it's not worth reporting while the site's future is unclear.</small> </p> nicholas 2010-08-20T09:37:19+00:00 journal TPF News website redesign http://use.perl.org/~jj/journal/40500?from=rss <p> I've just uploaded a new design for <a href="http://news.perlfoundation.org/">http://news.perlfoundation.org</a>. Based on the <a href="http://perldoc.perl.org/">perldoc.perl.org</a> style, it implements Phil Smith's idea for the "Explore Perl" toolbar. I'll blog in more detail about this later, but essentially we've now got a single list of links that appear on multiple sites but are maintained in <a href="http://github.com/jonallen/perldoc.perl.org/blob/master/static/exploreperl.js">a single place</a>. </p><p> Many thanks to Ask, Squeaky, Phil Smith, and Karen for their help and ideas. </p><p> P.S. As with any redesign there may be the odd browser issue or bug, so if anything looks amiss please email me at <a href="mailto:jj@jonallen.info">jj@jonallen.info</a> and I'll look into it. </p> jj 2010-08-16T19:57:22+00:00 journal Inside looking out http://use.perl.org/~redspike/journal/40499?from=rss <p>I am reading <a href="http://hop.perl.plover.com/">MJD's Higher Order Perl</a> again and its great to see that my time reading other books on Perl has not been wasted. The first time round I read the words but I did not understand them. Now I am on the inside looking out rather than on the outside looking in.</p><p>It matters not how many times I look around I always come back to Perl as it is now the language that I know more than any other. This is a really great thing to realise. </p><p>Sadly I missed YAPC::EU again this year and I have really missed meeting my friends there. I hope to make it next year. It always has the feel of a festival, if there were tents and bad sanitation it would be exactly like it.</p><p>A few weeks ago I had to compare two bank account numbers and before I knew what I had done I wrote </p><p>perl -e 'if ("0123456789" eq "0123456789"){print "yes"};' </p><p>on the command line. It did not dawn until later what this meant. It means that having bludgeoned my brain with so much Perl it has eventually and begrudgingly given up and decided to come along with me for the ride and even started to think in it without telling me. It just let its gaurd down and it slipped out.</p> redspike 2010-08-16T13:55:29+00:00 journal Eek! I wrote some Perl! http://use.perl.org/~Kake/journal/40498?from=rss I haven't written any Perl in a long time, but some fell out yesterday so I thought I'd mention it here. It's to do with Chinese text, specifically ways to grep in a traditional-simplified-insensitive way. More details <a href="http://kake.dreamwidth.org/45318.html">on my regular blog</a>. (Comments are enabled here, but preferred there &#8212; you can use OpenID or just sign your name so I know who you are.) Kake 2010-08-16T09:54:56+00:00 journal Some you win, some you loose http://use.perl.org/~nicholas/journal/40467?from=rss <p>So, my attempt to avoid <a href="http://www.lightbluetouchpaper.org/2010/01/26/how-online-card-security-fails/">3D Secure</a> was successful, but seems to have had the unintended side effect that I <a href="http://conferences.yapceurope.org/ye2010/news/616">sold my soul for 3 days</a>.</p><p>I feel that I have to categorically deny that my product roadmap is in doubt, and that the rumours of forking me to regain control are completely unfounded, and unworthy of any further comment.<nobr> <wbr></nobr>:-)</p><p>See you all at <a href="http://conferences.yapceurope.org/ye2010/">YAPC::Europe</a> next week. Right now, there's <a href="http://conferences.yapceurope.org/ye2010/news/617">another free ticket up for grabs</a>, thanks to <a href="http://www.shadowcat.co.uk/">Shadowcat</a>.</p> nicholas 2010-07-28T19:50:24+00:00 journal Announcing CPAN Testers 2.0 http://use.perl.org/~barbie/journal/40435?from=rss <p>After 6 months of development work, following 2 years worth of design and preparation, CPAN Testers 2.0 is finally live.</p><p>With the rapid growth in CPAN Testers environments and testers over the past few years, the previous method of posting reports to a mailing list had reached a point where the scalability was no longer viable. This was recognised several years ago and discussions for a new system had already begun, with the view that reports should be submitted via HTTP.</p><p>At the Oslo QA Hackathon in 2008, David Golden and Ricardo Signes devised the Metabase, with the design work continuing at the Birmingham QA Hackathon in 2009, where David and Ricardo were able to bring others into the thought process to work through potential issues and begin initial coding. A number of releases to CPAN and Github followed, with more people taking an interest in the project.</p><p>The Metabase itself is a database framework and web API to store and search opinions from anyone about anything. In the terminology of Metabase, Users store Facts about Resources. In the Metabase world, each CPAN tester is a User. The Resource is a CPAN distribution. The Fact is the test report. Today that&#8217;s just the text of the email message, but in the future it will be structured data. The Metabase specifies data storage capabilities, but the actual database storage is pluggable, from flat files to relational databases to cloud services, which gives CPAN Testers more flexibility to evolve or scale over time.</p><p>Meanwhile the CPAN Testers community was also attracting more and more interest from people wanting to be testers themselves. As a consequence the volume of reports submitted increased each month, to the point that the perl.org mail server was struggling to deal with all the mailing lists it hosted. The cpan-testers mailing list was submitting more posts in one day than any other list submitted in a month (in a year in some cases). Robert and Ask, very reasonably, asked if the testers could throttle their submissions down to 5k report posts a day, and set a deadline of 1st March 2010 to switch off the mailing list.</p><p>David Golden quickly took on the task to envisage a project plan, and work began in earnest in December 2009. With less than 3 months to the cut-off date, there was a lot of work to do. David concentrated on the Metabase, with Barbie working on ensuring that the current cpanstats database and related websites could move to the Metabase style of reports. Despite a lot of hard work from a lot of people, we unfortunately missed the 1st March deadline. Having throttled report submissions to a more manageable level, and although not complete, the target for HTTP submissions was in sight, Robert and Ask were very understanding and agreed to keep us going a little while longer.</p><p>Throughout March and April a small group of beta testers were asked to fire their submissions at the new system. It ironed out many wrinkles and resulted in a better understanding of what we wanted to achieve. The first attempts at retrieving the reports from the Metabase into the cpanstats database began in April, and again highlighted further wrinkles that needed to be addressed. After a month of hard testing and refinement, we finally had working code that went from report submission by a tester, storage into the Metabase, retrieval into the cpanstats database and finally presentation on the CPAN Testers family of websites.</p><p>During June the process was silently switched from testing to live, allowing reports to be fed through into the live websites. Due to the ease with which the new style reporting fit into the existing system, the switch largely went unnoticed by the CPAN testers community as well as the Perl community. A considerable success.</p><p>The CPAN Testers eco-system is now considerably larger than those early days of simply submitting handwritten reports by email to a mailing list, and the work to get here has featured a cast of thousands. Specifically for CPAN Testers 2.0, the following people have contributed code, ideas and effort to the project over the past six months:</p><ul> <li>Andreas K&ouml;nig</li><li>Apocalypse</li><li>Ask Bj&oslash;rn Hansen</li><li>Barbie</li><li>Chris Williams</li><li>Dan Collins</li><li>David Cantrell</li><li>David Golden</li><li>Florian Ragwitz</li><li>H.Merijn Brand</li><li>Jon Allen</li><li>Lars D&#618;&#7431;&#7428;&#7435;&#7439;&#7457; &#36842;&#25289;&#26031;</li><li>L&eacute;on Brocard</li><li>MW487</li><li>Nigel Horne</li><li>Ricardo Signes</li><li>Richard Dawe</li><li>Robert Spier</li><li>Serguei Trouchelle</li><li>Shlomi Fish</li><li>Slaven Rezi&#263;</li></ul><p>Barbie and David would like to thank everyone for their involvement. Without these guys CPAN Testers 2.0 would not have been possible. Thanks to everyone, we can now look forward to another 10 years and more of CPAN Testers.</p><p> <a href="http://www.cpantesters.org/">CPAN Testers</a> now holds over 7.5 million test reports covering nearly 11 years worth of testing Perl distributions. There have been over 1,000 testers in that time, and every single one has helped the CPAN Testers project to be the largest single community supported testing system of any programming language. For a full list of everyone who has contributed, visit the <a href="http://stats.cpantesters.org/testers.html">CPAN Testers Leaderboard</a>. A huge thank you to everyone.</p><p>With the Metabase now online and live, we can now announce an absolute deadline to close the mailing list. This is currently set as 31st August 2010. After this date all submissions via email will be rejected, and testers will be encouraged to upgrade their testing tools to take advantage of the new HTTP submission system. Many of the high volume testers have already moved to the new system, and we expect nearly everyone else to move in the next month. We will be tailing the SMTP submissions to catch those who haven't switched, such as some of the more infrequent testers, and warn them of the deadline.</p><p>More work is planned for CPAN Testers, from further validation and administration of reports, to providing more functionality for alternative analysis and search capabilities. Please check the <a href="http://blog.cpantesters.org/">CPAN Testers Blog</a> for our regular updates.</p><p>If you'd like to become a CPAN Tester, please check the <a href="http://wiki.cpantesters.org/">CPAN Testers Wiki</a> for details about setting up a smoke testing environment, and join the <a href="http://lists.perl.org/list/cpan-testers-discuss.html">cpan-testers-discuss mailing list</a> where many of the key members of the project can offer help and advice.</p><p>You can find out more about CPAN Testers at two forthcoming conferences. David Golden will be presenting <a href="http://www.oscon.com/oscon2010/public/schedule/detail/13759">"Free QA! What FOSS can Learn from CPAN Testers"</a> at OSCON and Barbie will be presenting <a href="http://conferences.yapceurope.org/ye2010/talk/2891">"CPAN Testers 2.0 : I love it when a plan comes together"</a> at YAPC::Europe.</p><p>CPAN Testers is sponsored by Birmingham Perl Mongers, and supported by the Perl community.</p><p>You can now <a href="http://blog.cpantesters.org/press-release-ct20-20100705.pdf">download the full and complete Press Release</a> from the CPAN Testers Blog. If you have access to further IT news reporting services, please feel free to submit the Press Release to them. Please let us know if you are successful it getting it published.</p><p>Cross-posted from the <a href="http://blog.cpantesters.org/diary/83">CPAN Testers Blog</a> </p> barbie 2010-07-05T09:50:22+00:00 journal Birmingham.pm Technical Meeting - Wednesday 26th May 2010 http://use.perl.org/~barbie/journal/40364?from=rss <code> Event:&nbsp;&nbsp;&nbsp;Birmingham.pm Technical Meeting<br> Date:&nbsp;&nbsp;&nbsp;&nbsp;Wednesday 26th May 2010<br> Times:&nbsp;&nbsp;&nbsp;from 7pm onwards (see below)<br> Venue:&nbsp;&nbsp;&nbsp;The Victoria, 48 John Bright Street, Birmingham, B1 1BN.<br> Details:&nbsp;<a href="http://birmingham.pm.org/tech/next">http://birmingham.pm.org/tech/next</a> <br> </code> <p> <b>Talks:</b> </p><ul> <li>Accelerated web development with Catalyst [Richard Wallman]</li><li>CPAN Testers 2.0 - "I love it when a plan comes together" [Barbie]</li></ul><p> <b>Details</b> </p><p>This month we welcome a returning guest speaker, Richard Wallman, who will be taking a look at how Catalyst has eased the development lifcycle of websites, from his own experiences. In addition I'll be looking at the progress of the CPAN Testers 2.0, and looking at some of the near future plans for CPAN Testers.</p><p>As per usual, this month's technical meeting will be upstairs at The Victoria. The pub is on the corner of John Bright Street and Beak Street, between the old entrance to the Alexandra Theatre and the backstage entrance. If in doubt, the main entrance to the Theatre is on the inner ring road, near the Pagoda roundabout. The pub is on the road immediately behind the main entrance. See the map link on the website if you're stuck.</p><p>As always entry is free, with no knowledge of Perl required. We'd be delighted to have you along, so feel free to invite family, friends and colleagues<nobr> <wbr></nobr>;)</p><p>Some of us should be at the venue from about 7.00pm, usually in the backroom downstairs. Order food as you get there, and we'll aim to begin talks at about 8pm. I expect talks to finish by 9.30pm, with plenty of time for discussion in the bar downstairs.</p><p> <b>Venue &amp; Directions:</b> </p><p> The Victoria, 48 John Bright Street, Birmingham, B1 1BN<br> - <a href="http://www.pubs247.co.uk/pubPages/pub.asp?id=24358&amp;from=&amp;promotion=">Pub Details</a> <br> - <a href="http://birmingham.pm.org/images/upload/victoria.jpg">Picture</a> <br> - <a href="http://www.google.co.uk/maps?hl=en&amp;client=firefox-a&amp;q=the+victoria+pub&amp;near=Birmingham&amp;radius=0.0&amp;cd=1&amp;cid=52482921,-1893619,7492755984503563963&amp;li=lmd&amp;z=14&amp;t=m">Google Map</a></p><p>The venue is approximately 5-10 minutes walk from New Street station, and about the same from the city centre. On street car parking is available see full details and directions on the <a href="http://birmingham.pm.org/tech/next">website</a>.</p><p> <b>Times:</b> </p><p>These are the rough times for the evening:</p><ul> <li>food available until 9.00pm</li><li>talks: 8.00-10.00pm</li><li>pub closes: 11.00pm</li></ul><p>Please note that beer will be consumed during all the above sessions<nobr> <wbr></nobr>;)</p> barbie 2010-05-24T19:26:06+00:00 journal Ding Dong! The Witch is Dead! http://use.perl.org/~nicholas/journal/40320?from=rss <p> <code>$ git show --stat 75108aefc8b50fcf<br> commit <a href="http://perl5.git.perl.org/perl.git/commit/75108aefc8b50fcf2f053da2df34756c7b269a1f">75108aefc8b50fcf2f053da2df34756c7b269a1f</a> <br> Author: Nicholas Clark &lt;nick@ccl4.org&gt;<br> Date: Mon Apr 19 20:35:54 2010 +0100<br> <br> Remove Switch from the core distribution. Get it from CPAN now.<br> <br> &nbsp;MANIFEST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;9&nbsp;-<br> &nbsp;Porting/Maintainers.pl&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;10&nbsp;-<br> &nbsp;dist/Switch/Changes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;121&nbsp;-------<br> &nbsp;dist/Switch/MANIFEST&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;9&nbsp;-<br> &nbsp;dist/Switch/META.yml&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;14&nbsp;-<br> &nbsp;dist/Switch/Makefile.PL&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;-<br> &nbsp;dist/Switch/README&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;26&nbsp;--<br> &nbsp;dist/Switch/Switch.pm&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;875&nbsp;-----------------------------------------------<nobr> <wbr></nobr> <br> &nbsp;dist/Switch/t/given.t&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;272&nbsp;---------------<br> &nbsp;dist/Switch/t/nested.t&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;35&nbsp;--<br> &nbsp;dist/Switch/t/switch.t&nbsp;&nbsp;|&nbsp;&nbsp;272&nbsp;---------------<br> 11 files changed, 0 insertions(+), 1650 deletions(-)<br> </code> </p><p>It's taken about 2 years, from the original idea on how to smoothly migrate modules out, getting agreement from Andreas and Jos in the buffet queue at <a href="http://conferences.yapceurope.org/ye2008/">YAPC::Europe 2008</a>, a lot of "fun" re-ordering <code>@INC</code>, coding by Andreas, Jos, BinGOs and David Golden, and Jesse getting a 5.12.0 release out, but finally, now Ding-Dong! The Witch Is Dead.</p><p>Albeit only in <a href="http://perl5.git.perl.org/perl.git/shortlog/refs/heads/blead">blead</a>. Not even in a dev release <b>yet</b>, let alone stable. But these things will come...</p> nicholas 2010-04-21T21:10:27+00:00 journal Random thing to phase Dean http://use.perl.org/~nicholas/journal/40319?from=rss <p>It seems that I haven't seen <i>The Sound of Music</i> recently enough*. I can't remember more than a couple of lines from any of the songs, despite being confident about the tunes. Hammerstein would be frustrated. Rogers, I assume, happy enough. <a href="http://www.unixdaemon.net/">Dean Wilson</a> likely will comment that I have too much time on my hands, as seemingly surreal blog entries like this one seem to perturb him.</p><p> <small>* I don't know whether this is a bug or a feature.</small> </p> nicholas 2010-04-21T20:58:26+00:00 journal Rocket fuel review http://use.perl.org/~nicholas/journal/40294?from=rss <p>So, mostly conclusions without much justification. Of the recent consumption:</p><dl> <dt> <a href="http://www.westons-cider.co.uk/Shop/Sparkling-Ciders/Medium-Dry-Ciders/Henry-Westons-Vintage-Special-Reserve~~12x500ml/">Weston's Vintage Special Reserve</a></dt><dd>I didn't like this as much as the first time I had it. It feels like it's over doing it somehow.</dd><dt> <a href="http://www.thatcherscider.co.uk/products/singlevarietal/katy/">Thatchers' Katy</a> </dt><dd>Nicer than the Special Reserve.</dd><dt> <a href="http://www.westons-cider.co.uk/Shop/Sparkling-Ciders/Perry-and-Specialist-Ciders/Perry/">Weston's Perry</a> </dt><dd>Want more. Seriously drinkable. Seriously dangerous*.</dd><dt>Brother's Festival Cider</dt><dd>I didn't like it that much. It has a slight rough undertone, like there's a trace of scrumpy in it. But I wasn't trying to drink paint stripper (this time).</dd></dl><p>Unfortunately I have run out of Katy and Perry. There will have to be a third place drink-off between the Special Reserve and the Festival Cider. Carefully. And not on a school night.</p><p> <small>* Trumps Apple Hooch in the "danger" category. To me, Apple Hooch tastes like Appletize. Problem is that I know that Appletize is non-alcholic, and don't pace myself. Only Apple Hooch is (well, was) 5% ABV. Weston's Perry is 7.4%.</small></p> nicholas 2010-04-04T20:22:16+00:00 journal svn to mercurial? http://use.perl.org/~nicholas/journal/40285?from=rss <p>Dear lazyweb...</p><p>We're using Trac at work. It's made of <a href="http://hates-software.com/">software</a>, but some software is more equal than others. In particular, we're planning to move from subversion to mercurial, because Trac seems to work nicely (enough)* with mercurial, unlike git.</p><p>So, what's the best way to convert a 20000 revision svn repository to mercurial? We have branches, which it would be nice to convert to real branches. I have some idea how to do this for svn to git, including branches and tags, but not for mercurial.</p><p> <small>* svn <i>vs.</i> Trac - which sucks more? The ultimate cagematch.</small> </p> nicholas 2010-04-01T14:14:06+00:00 journal Fixing Mailman with Perl http://use.perl.org/~BooK/journal/40266?from=rss <p>Mailman is useful. Mailman works. Mailman is ubiquitous. I am subscribed to over 50 mailing-lists managed by Mailman.</p><p> But Mailmand is software, and therefore <a href="http://hates-software.com/">hateful</a>. </p><p>My particular Mailman hate is the <code>nodupes</code> parameter.</p><blockquote><div><p> <i> <b>Avoid duplicate copies of messages?</b> </i> </p><p> <i>When you are listed explicitly in the To: or Cc: headers of a list message, you can opt to not receive another copy from the mailing list. Select Yes to avoid receiving copies from the mailing list; select No to receive copies.</i> </p><p> <i>If the list has member personalized messages enabled, and you elect to receive copies, every copy will have a X-Mailman-Copy: yes header added to it.</i> </p></div> </blockquote><p>I like duplicate email. Moreover, I like the <code>List-Id</code> header that makes emails sent through a list <i>special</i> (at least in the sense that they can be filtered <i>automatically</i> by more tools, and I can just delete the stuff that piles up in my Inbox). And by the way, how could Mailman be really sure that I got that other copy? Just because the headers say so? Bah.</p><p>Oh, and I also hate the fact that <i>Set globally</i> never worked for me with this option.</p><p>So, because I'm lazy, and I don't want to go clikety-click to first, get a reminder of the random password that was assigned to me years ago, and two, login and change that annoying option, and because <b>I don't want to do that fifty times, over and over again</b>...</p><p> I wrote and put on CPAN <a href="http://search.cpan.org/dist/WWW-Mailman/">WWW::Mailman</a>, designed to automate that kind of tedious task out of my life (and hopefully yours). Examples included, I know you're lazy too. </p><p><small>PS: I've been told there <i>is</i> a command-line interface to Mailman, but it is reserved to people managing Mailman on the server.</small></p> BooK 2010-03-25T01:07:02+00:00 journal Effective Perl Programming http://use.perl.org/~redspike/journal/40259?from=rss <p>I bought 'Effective Perl Programming' by Joseph N. Hall and Randal L. Schwartz, about two years ago along with 'Intermediate Perl' and 'How to Joust Underwater'. When it arrived I quickly flipped through it and decided I could not really understand a lot of it. My decision then was that it was not the book to read until it looked more friendly. </p><p>It was spotted last week and jumped out of my bookshelf. As I opened it and started to read it, it did not seem to be the book that I had first encountered. In fact it was really quite accessible and rather exciting. I greedily started reading it and skimming through the code examples. Not until I had read it for about an hour did I see that what was once a mystery was now becoming clear. To my delight I could see things that I could use and apply.</p><p>This I am sure is not unusual. It was just the right book at the right time, even though it had collected dust on the shelf for a couple of years. I particularly liked the 'Schwartzian Transform'. It felt like reading module source code because it looks like alot of the examples are realword rather than contrived. If I feel that the code is real code then I do seem to take it more seriously. This may be unfair of me to do but its one of the ways a subject keeps my attention.</p> redspike 2010-03-22T15:10:29+00:00 journal This is the day - or is it tomorrow? http://use.perl.org/~redspike/journal/40244?from=rss <p>I have made a decision. Having made friends with the internet again. (I had a long and protracted argument with it and decided that we ought to go our seperate ways for a while whilst I found out what the rest of the world was like.) My decision - to eat more cheese, if that was at all possible and to plan a new project out and do the whole thing in Perl. I have worked piecemeal on stuff and have several projects that have been done sort of half-heartedly in Perl or PHP or even ASP but they have all just sort of grown out of themselves rather than being crafted and started from the beginning without having the nagging feeling that I am doing it the wrong way or it was a Thursday at the time.</p><p>Its going to be the same sort of decision to do everything in Vi from a certain date and sticking to it however painful or tempting it was to go back to the way I was doing it before, which actually I can't remember. So this is it brothers and sisters its Perl or bust. Not sure what that means, but I have just spent two days having to sort something out in DOS which I think has finally pushed me over the edge into some semblance of sanity. What it has really done is made it as plain as the nose on my face that the only way to get something done is to set sensible goals and get them done. As I did not have a choice whether I could program in DOS or not I just got on with it.</p><p>I remember the Wrox press books had and still have (unless someone has stolen into my house and gone through all the books and removed them.) 'Just Do It' printed on pages in between chapters. I often talked to them and explained that I could not just do it as I did not know what I had to just do. Now I do understand the relevance. Thinking is not doing and neither is thinking necessarily learning in the same way that doing is not always thinking or learining. However they can be all three.</p><p>The thing about the last few months is that I have spent a long time saying to myself - I just need to learn a little more and I will be ready to do this or that. Where in fact waiting for the time when I have satisfied myself that I know enough is never going to happen. I just thought that I did not know enough. Well its obvious I do know enough so I am going to stop pissing about.</p> redspike 2010-03-15T00:08:48+00:00 journal Gone http://use.perl.org/~Ovid/journal/40243?from=rss <p>Like many others, I'm no longer posting here very much. You'll find my new technical journal at <a href="http://blogs.perl.org/users/ovid/">blogs.perl.org</a>. It's much shinier.</p><p> <a href="http://siteanalytics.compete.com/use.perl.org/">As you can see, use.perl visits have been dropping for a while</a> (blogs.perl.org is too new to show up on that search) and the <a href="http://use.perl.org/">front page of use.perl has been sadly neglected</a>. As for blogs.perl.org, after an initial rough start, <a href="http://blogs.perl.org/users/adam_kennedy/2009/12/migrating-from-useperlorg-to-blogsperlorg.html">plenty</a> <a href="http://blogs.perl.org/users/thefinalcut/2009/12/first-post-on-the-shiny-new-onion.html">of</a> <a href="http://blogs.perl.org/users/limbicregion/2009/11/goodbye-useperlorg-hello-blogsperlorg.html">people</a> are switching over and are very happy with the shiny.</p><p>I have fond memories of use.perl.org, but it's just too old and out-of-date. Come on over to our new platform and look around. Plus, <a href="http://github.com/davorg/blogs.perl.org/issues">tell us what you want changed about it</a>. (To be fair, while I was involved in the project to get it launched (mostly kibitzing and asking why things were stalled -- I'm such a marketroid<nobr> <wbr></nobr>:), the hands-on work was Dave Cross, Aaron Crane and the wonderful folks at <a href="http://www.sixapart.com/">SixApart</a>.)</p> Ovid 2010-03-14T08:02:43+00:00 journal Intermeditae Perl Review http://use.perl.org/~redspike/journal/40226?from=rss <p>Well after what seems like several decades I am finally going to Review 'Intermediate Perl by Randal L. Schwartz, brian d foy and Tom Phoenix. The book is on the whole very well written and has an amusing style which belies its importance. Initially I read Randal Schwartz and Tom Phoenix and brian d foy which gave me the basics, enough in fact to use some cgi scripts that, although now need a re-write to due my added knowledge, are still in use today. </p><p>I then went onto Programming Perl by Larry Wall, Tom Christiansen, Jon Orwant which I read as a sort of novel, when I told this to Larry Wall at a YAPC he said that it was mostly fiction anyway. It introduced me to alot of the advanced features in Perl but was a bit heavy going. After I had read it I wondered if there was something inbetween this and Learning Perl, something intermediate. </p><p>I know it seems obvious not but I did not look for a book called Intermediate Perl. I found this sort of pattern happening a lot in my jourmey through Perl, the obvious is so obvious I miss it. I have tried to start looking for the obvious before I hare off and look for the complicated and down right obscure which always seem more easy to see. As I had not cultivated the culture of <b>'The Bleeding Obvious'</b> I bought a few others which, although good in their way were not really suitable at the time for where I was at. Eventually I got a copy of 'Intermediate Perl' and it all made more sense.</p><p>I read another review online which suggested a different order in which to read the chapters. The suggested thing was to read Ch 3 after reading Ch 10 and then read Ch 15 because it was thought that you need to know about modules after learning about building larger programs. This I did and it seemed to make more sense. Apart from my normal gripe about not explaining how to get help through Perldoc and a few examples which when typed in verbatum do not work (bottom of page 4 in particular its is not that it is wrong but to make it run you have to do a little more than is written) the book helped alot. This kind of thing is not a problem half way through the book, any book, a little assumed knowledge has been learned, but it is important to make things absolutey implicit in the first few examples. Implied knowledge is an easy way to dishearted anyone and could in extreme cases cause someone to give up. Reading it through at least twice meant that a few things clicked eventually and gave me a sense of achievement when I understood the concepts and put some of them to the test. The story of Gilligan, Skipper, The professor and crew meant a simple but powerful thread kept the example real. Although imagined, these examples explained in fairly simple terms some very complicated ideas that I found fairly easy to apply to real world applications. Having read 'Programming Perl' first meant that I had gone a long way to understanding many of the ideas but anyone going about it in the right order would have less of a virtical wall to look at when they got to the 'Camel'. I use Intermediate Perl as a reference at the moment and to re-read certain chapters when I have a quiet moment.</p><p>I would recommend this book to anyone who has just got through Learning Perl or who is coming to Perl from another language and wants to start in a comfortable place before scaling the heights.</p><p>Whilst reading the chapter on references I was struck by the one of the many lighthning strikes out of the snaffed and blurreddy that is <b>'The Bleeding Obvious'</b>. It may be called a reference but I thought that that was just its name. Unlike a the fact that a variable is called a variable because its value can vary but not its declared name,(I know that that is not necessarily the case as it is its address in memory that does not change or perhaps something else that I don't know yet, but humour me) a reference is called a reference because it is a reference to some thing, usually a scalar, array, subroutine or hash or something. As a reference it refers to something. You cannot believe how I wondered how I had managed to get through at least 3 rather large books before it finally sank in. I am not sure if it was the fact I did not read the right books in the right order or the fact that I was not really reading what I was reading. Either way, I have had the same experience several times. I think that because it has always been pointed out that Larry Wall is a linguist and therefore has crafted Perl in a liguistic way that I assumed the opposite. I have the same experience with other languages and with other things too but that is part of the joys, or not, of not taking the obvious as obvious. Tell me one thing and I will often assume the opposite because that is what I thought you meant, and just when I think I have got it I will the think the opposite of the opposite which is of course the obvious but not everytime. Sounds dumb when you write it down but with everyone trying to be so damn clever I am not sure who is genuinely clever and who is trying to look clever by inference. In Larry's case I think he is just being genuine. </p><p>I will do a more indepth review of this book as it has helped me a great dealm but this will do to get started for now.</p> redspike 2010-03-05T10:34:59+00:00 journal A debt owing http://use.perl.org/~neilh/journal/40213?from=rss I would just like it on record that I owe <a href="http://use.perl.org/~nicholas/">nicholas</a> a house move neilh 2010-02-28T14:56:59+00:00 journal So we're getting Calais back? http://use.perl.org/~nicholas/journal/40189?from=rss <blockquote><div><p>The ambitious scheme follows a move by the French to cash in on the London Olympics by rebranding their region &#8216;part of Britain&#8217;.</p></div></blockquote><blockquote><div><p>The ploy has helped them land contracts with a string of foreign teams to train in France ahead of the 2012 Games.</p></div></blockquote><blockquote><div><p>Boulogne and Calais now claim that the Britain no longer stops at the white cliffs of Dover.</p></div></blockquote><blockquote><div><p>&#8216;I consider that we are the south of England,&#8217; said Mr Dupilet. &#8216;And because we're the south of England it's normal that we would associate ourselves with this extraordinary event.&#8217;</p></div></blockquote><p>Eh. This is putting pragmatism ahead of patriotism. Most unusual.</p><blockquote><div><p>Mr Dupilet said people who wanted a comfortable commute to London would be far better off basing themselves in northern France than in other parts of Britain.</p></div></blockquote><p> <b>That</b> is key, and I'm surprised that it's taken <b>this</b> long to get going. As (I think) <a href="http://astray.com/">L&#233;on</a> said 5 years ago, it's not 1h15 from Calais to London, and 1h15 back, it's <b>only a 15 minute commute to London</b>, thanks to the timezone difference. Which would really help the lifestyle. And it ties up with something Pierre Denis said. If your job allows you to live anywhere in France, you'll choose the south. Even 3% of the population being able to do this has started to massively skew property prices there. Whereas the south east of England is and has long been desirable as a location for those who commute to London, so there's no new skew as location unconstrained people increase.</p><p>Result - Kent is crowded and expensive. However, the Pas de Calias is much emptier, and much less expensive. All it needs is a commuter service. And of course:</p><blockquote><div><p>&#8216;Who wants to go to Birmingham?&#8217; he said. &#8216;In the Pas-de-Calais the French lifestyle is better. And as for the food over there, well, forget it.&#8217;</p></div></blockquote><p>From the <a href="http://www.dailymail.co.uk/news/worldnews/article-1248558/Metro-commuter-trains-Calais-Kent-running-2012-Olympics.html">Daily Fail</a>, but not the usual fayre. And if you're wondering about my choice of subject:</p><blockquote><div><p>England ruled Calais for more than 200 years after being besieged and captured by Edward III in 1347.</p></div> </blockquote> nicholas 2010-02-17T20:01:43+00:00 journal don't do this http://use.perl.org/~nicholas/journal/40186?from=rss <p>It's just occurred to me that <a href="http://groups.google.com/group/develnytprof-dev/msg/51a1c7650532210b">it might be possible</a> to <code>goto \&amp;sub_ref</code> out of a <code>BEGIN</code> block. After all, they're really subroutines at heart. So, does it work?</p><blockquote><div><p> <tt>$ cat sick.pl<br>#!perl -w<br>use strict;<br> <br>sub sick {<br>&nbsp; &nbsp; warn "Yuck!";<br>}<br> <br>BEGIN {<br>&nbsp; &nbsp; goto \&amp;sick;<br>}<br> <br>__END__<br>$ perl sick.pl<br>Yuck! at sick.pl line 5.</tt></p></div> </blockquote><p>Yep. Sure does.</p><p>Don't do this.</p><p>This is where someone points me at prior art from 10 years ago. There is, after all, nothing new under the sun.</p> nicholas 2010-02-16T18:03:08+00:00 journal Confidence in one thing leads to confidence in another http://use.perl.org/~redspike/journal/40180?from=rss <p>Since FTFM(Finding The F*****g Manual - courtesy of <a href="http://use.perl.org/comments.pl?sid=44500&amp;cid=71678">dagolden</a>) and now being able to RTFM whenever and wherever I am as long as I have access to Perl means that I don't have to worry about remembering everything or take loads of dead trees around with me. I used to wander off with a laptop and a book in hand, sit under a shady tree with the sound of the wind rustling in the trees and fawns pronking in the meadow then settle down to have a leisurely look at some aspect of Perl, start testing something out, forget the exact sytax and have to thumb through pages and break the train of thought, by which time it had started to rain and the fawns had gone home for tea and I had forgotten what I was trying to do and would have to start all over again.</p><p>Its a amazing what a little confidence, in one language brings to another and how it takes all the anxiety out of the process of getting things done when you don't know quite what you are doing but know where to go. Finding the door to all knowledge and wisdom that is Perldoc that has been hidden from me has given me new found confidence, even perhaps a rather cavalier attitude to other new things too. </p><p>I have had to learn how to use Joomla as it is the preferred tool of one of my clients. I have tossed around with it a few times but never really got to grips with it in the past. As there is an incentive to use it I found myself getting to grips with it a bit more easily, even though my first reaction was to resist it. </p><p>There is a little lesson there too: learning is greatly improved when there is a sensible achievable goal with a little bit of lookah involved and a doable deadline . Not the huge, re-invent the world in a day type mountains I have set myself in the past. Not impossible if you have all the tools to hand but a bugger when you can't find the secret to planet making in Mrs Beeton's, Omelettes for All Occasions.</p><p>As learning experiences go it was not too bad after all it is like using a WYSIWYG editor with a few extra functions. What at first seems a weird way of linking everything together, is not in the end a bad concept, its probably more the case that the documentation is aimed at the non-programmer, which did help. Of course I am always comparing experiences to see if one will help with the other. </p><p>As soon as I had installed the system, had a play around with a template or two and then put some content in to be able to get a feel for what I was looking at, I opened the php and css in a text editor and started to customise everything in the code rather than from the web interface.</p><p>If I had had to delve too much into the PHP I may not have enjoyed the experience quite so much as it is not my language of choice and I could see from the little of the code that I did see that I would not have done it that way if I had started from there in the first place. I was just pleased that I did not run off screaming into the wind.</p><p>Honestly, a few months ago I was so hacked off with all programming languages that I would not have attempted to even install a new cartridge in my printer in case it involved me writing Post Script. The difference now is that the more time that I have been learning Perl the better I have become at seeing the commonalities in all languages and systems and so when faced with a new challenge things seem clearer. I am nothing if not persistent.</p><p>I think it proves that I am climbing the tree and tasks that seemed a real arse ache a few months ago are now possible because Perldoc had taught me one vital lesson - have the confidence to know that you will be able to get to the next step, and after that you will be able to get to the next. Belief in the ability to be able to do something because you know how to find out how to do it.</p><p>I may be repeating myself here, I said I might be repeating myself here but it is worth repetition, I said its worth repetition.</p> redspike 2010-02-14T23:58:55+00:00 journal Chip and Pin counterfud exposed. http://use.perl.org/~nicholas/journal/40178?from=rss <p>So, <a href="http://www.lightbluetouchpaper.org/2010/02/11/chip-and-pin-is-broken/">Chip and Pin is broken</a>.</p><p>But the fun part is in the comments. Comment 19 from the anonymous "Scrutineer" includes:</p><blockquote><div><p>The attack was never successfully executed. To be successful it had to be done against a card that was reported lost and stolen. Nowhere in the report do they assert that they reported their cards they tested as lost or stolen! All they have done is prove a genuine card can be processed with odd and inconsistent CVR and TVR settings. Hardly compelling evidence.</p></div></blockquote><p>Which <b>of course</b> misses the point - it's about the interval between theft and discovery of theft - the time that someone else has your card <b>before</b> you're able to successfully report it stolen. This attack changes the game from "the PIN protects you better than a signature - now if someone steals your card they need to guess your PIN" back to "They only need to steal your card" (and actually easier, because they don't need to learn to forge signatures).</p><p>But the best bit is comment 22:</p><blockquote><div><p>The chap &#8220;Scrutineer&#8221; who posted comment 19 seems to have forgotten to sign it!<br> Anyway he&#8217;s not very good at anonymity:<br> <br> $ whois 193.128.116.71<br> &#8230;.<br> address: APACS (Administration) Ltd<br> address: 14 Finsbury Square<br> address: London<br> address: EC2A 1BR<br> address: England, UK<br> <br> Pity APACS couldn&#8217;t get it together to put up a spokesman for Newsnight</p></div></blockquote><p>Touch&#233;</p><p>Update: It's really someone at APACS. Not an exercising in framing, taking advantage of a proxy:</p><blockquote><div><p>A spokeswoman for UK Card Association said the posts violated staff internet-use guidelines.</p></div></blockquote><p> <a href="http://www.theregister.co.uk/2010/02/24/chip_and_pin_rant/">http://www.theregister.co.uk/2010/02/24/chip_and_pin_rant/</a> </p> nicholas 2010-02-12T17:31:11+00:00 journal Not Your Father's Von Neumann Machine http://use.perl.org/~nicholas/journal/40169?from=rss <p>I really liked this talk - <a href="http://www.infoq.com/presentations/click-crash-course-modern-hardware">This Is Not Your Father's Von Neumann Machine by Cliff Click</a>*</p><p>It's well worth watching. It has really nicely presented explanations of:</p><ol> <li>How and why a modern CPU executes out of order, and why cache misses are king.</li><li>How memory architecture means that two cores can cause writes to be read out of order, and the implications (your code goes boom<code>^W</code>SEGV).</li></ol><p> <small>* Brian Goetz was co-author of the talk, and co-presented it on its first outing, but this presentation of it just has Cliff Click.</small> </p> nicholas 2010-02-08T21:00:35+00:00 journal ... unless you're a Sikh http://use.perl.org/~nicholas/journal/40166?from=rss <blockquote><div><p> <a href="http://news.bbc.co.uk/1/hi/uk/8500712.stm">Although Sikhs carrying the Kirpan are exempt from prosecution under the offensive weapons act</a></p></div> </blockquote><p>I didn't know about that one. I knew that a practising member of the Sikh faith is allowed to wear a turban instead of a helmet when riding a motorcycle. I wonder how many other such exemptions are carefully written into UK law. I need a list - Wikipedia you <a href="http://www.google.com/search?q=site%3Aen.wikipedia.org+list">fail</a> me!<nobr> <wbr></nobr>:-(</p> nicholas 2010-02-08T11:04:21+00:00 journal Memory usage http://use.perl.org/~nicholas/journal/40165?from=rss <p>There were a few things that caught my attention in <a href="http://www.ustream.tv/recorded/4409735">Facebook's presentation on HipHop</a>, their PHP to C++ converter. It sounds like it relies on static analysis of the entire program's source, hence why they can't support <code>eval</code>, <code>create_function</code> <i>etc.</i> (22m25s in). I suspect that that sort of restriction would be, um, "interesting", in a general CPAN using environment, as a lot of modules build on various low level code that encapsulates <code>eval</code>, such as the traditional way <code>h2xs</code> did constants via <code>AUTOLOAD</code>. Also, as it's different runtime from Zend, so extensions need to be ported to it (19m in).</p><p>However, the most interesting part was a an early slide about memory usage, at 6m20. Transcribed:</p><blockquote><div><p>150MB</p><blockquote><div><p> <tt>for ($i = 0; $i &lt; 1000000; $i++ ) {<br>&nbsp; &nbsp; &nbsp; $a[] = $i;<br>}</tt></p></div> </blockquote><p> 700MB</p><blockquote><div><p> <tt>for ($i = 0; $i &lt; 5000000; $i++ ) {<br>&nbsp; &nbsp; &nbsp; $a[] = $i;<br>}</tt></p></div> </blockquote><p> (700M - 150M) / 4,000,000 = 144 BYTES</p></div> </blockquote><p>Does PHP really consume 144 bytes per integer value? Is that on a 32 bit or 64 bit machine?</p><p>For comparison, here is Perl:</p><blockquote><div><p> <tt>$ perl -le 'for ($i = 0; $i &lt; 1000000; $i++ ) { push @a, $i; }; print `cat<nobr> <wbr></nobr>/proc/$$/statm` * 4 / 1024'<br>22.4765625<br>$<nobr> <wbr></nobr>./perl -le 'for ($i = 0; $i &lt; 5000000; $i++ ) { push @a, $i; }; print `cat<nobr> <wbr></nobr>/proc/$$/statm` * 4 / 1024'<br>118.44140625</tt></p></div> </blockquote><p>which works out at 25.155 bytes per integer value, or under 20% of their figure for PHP. The odd number of bytes will be the <code>malloc</code> overhead spread across all the structures allocated from the same arena.</p><p>I have no idea what the usage of Python or Ruby are like, but there's a comment in the <a href="http://code.google.com/p/unladen-swallow/wiki/ProjectPlan">Unladen Swallow wiki</a>:</p><blockquote><div><p>Here at Red Hat we use Python for a lot of things. What we've observed is that execution performance is not the main issue (although it improving it would be greatly appreciated), rather it's the memory footprint which is the problem we most often encounter. If anything can be done to reduce the massive amount of memory Python uses it would be a huge win. I would encourage you to consider memory usage as just as important a goal as execution speed if you're going to tackle optimizing CPython.</p></div></blockquote> nicholas 2010-02-07T16:20:40+00:00 journal Its not kept behind the scullery maid under an aarvark http://use.perl.org/~redspike/journal/40162?from=rss <p> <b>How to learn how to get help in Perl </b> </p><p>I made a great discovery today but it has taken me a few years to get to it. I have wondered why it has been so hard to get into the shiny ball that surrounds some of the programming languages. This is not just Perl but many of them. I started to compare the way I learn text editors with the way I have learned programming languages. Vi was the first real editor I decided to learn.</p><ol> <li>Started it at the command line</li><li>Wondered how the hell I opened a file</li><li>Wondered how the hell I closed a file</li><li>Wondered how the hell I edited it</li><li>Wondered what all the fuss was about</li><li>I then bought a book and read it</li><li>Understood somethings and not others</li><li>Discovered how powerful it was and realised what all the fuss was about</li><li>Flirted with the idea of using it all the time</li><li>Found I could use it to do something I needed to do</li><li>Discovered how to use the help files</li><li>Understood what to do with a file and to do something useful that I could do however small</li><li>Used it infrequently when I had to during an ssh session on a server or just played with it</li><li>One day decided to use it all the time and be damned</li><li>It took a bit of working out and the first project I did with it took at least twice as long as normal</li><li>Now I use it all the time except when I am using Emacs in fact I cannot imagine life without it</li></ol><p>So what is the difference with programming? Well I thought there would not be too much after all people have said 'if you can use Vi you can program'. So here we go with Perl.</p><ol> <li>Started it at the command line</li><li>Wondered how the hell I created a variable</li><li>Wondered what the hell I did with a variable once I had one</li><li>Wondered how the hell made anything do anything to do anything</li><li>Wondered what all the fuss was about</li><li>I then bought a book and read it</li><li>Understood somethings and not others</li><li>Discovered how powerful it was and realised what all the fuss was about</li><li>Flirted with the idea of using it all the time</li><li>Found I could use it to do something I needed to do</li><li>Null</li><li>Null</li><li>Used it for a few scripts which help with some very basic cgi stuff</li><li>Would liked to have used it for lots of things but could not work out how</li><li>Became frustrated because it seemed like a shiney ball that I could not get into</li><li>I do not use it every day to do stuff</li></ol><p>The big difference which is glaringly obvious now, but I had not seen before is the <b>help system</b> and <b>understanding something I could do that was useful.</b></p><p>I came to this conclusion from the other end of the stick by trying to see where I was falling down and why I could not dash a script off when I needed to do something. I knew that if I was to use it to achieve the programming goals I needed to use it frequently to be able to progress onto larger programs that I have in mind.</p><p>It came to the fact that I could not remember things sometimes. I related this to my Vi experience and realised that I had had the same sort of problem but that had not stopped me from using it everyday. The difference was that it was so hard to get help from the help system. In fact I had been using the web for quick howtos and stuff had made it harder as it was a second hand help system in a way, it was not from the guts if you like.</p><p>I was walking around the office talking to myself and gesticulating a pieces of paper and trying to see how I could get the kind of help from Perl than I did from<nobr> <wbr></nobr>:h in Vi.</p><p>Of course its perldoc and man perlmodlib. I had played around with it but at no point had any book walked me through the way to use it. I sort of bumbled through and got by the best I could by using books and search engines. While learning any program like vi, emacs or Open Office the help files are there and most are accessible from a help menu or command. Books are bought and read and understood and exercises accomplished. When I forget something I can look it up in the help files, I do it without thinking. So once you learn one program and read some books, you know that there will be a help system to hold your hand when you need it. The book is part of the help system in a way but it is never implied it is just there and assumed that it will be used.</p><p>Switching to learning a programming language the same is not true there is not a system called help. In Java there are loads of documentation and tons of libraries of classes to wade through. In Perl there is perdoc. These two are alluded to but not really explained. You get instructions like 'There are thousands of libraries to get to do all the things you want to do without writing code' or 'There is always perldoc to help you out and thousands of modules'. Similar direction are found in program books referring to the help system, but everyone knows about help systems its there in the culture of using a program. </p><p>Once I looked at the similarities and differences in learning programming and learning a program and treated them the same it dawned on me that you all out there must be able to find stuff in perldoc that I am missing. So I knew I had to find a way to get what I wanted to know out of the Perl Help System. I looked on the net and looked in books for the bit that I was missing. I got to perldoc but it did not tell me everything. I askerd on IRC where was the list of stuff on Perl that is on the perldoc website and I got the answer. Perldoc perl or perldoc perltoc. WHY IS IT NOT THE FIRST CHAPTER IN ANY PROGRAMMING BOOK OR ON THE FIRST PAGE OF A WEBSITE THAT EXPLAINS HOW TO FIND OUT WHAT YOU WANT TO KNOW? I found it but it has taken me ages to find it. I new it was there but did not know how to access it. If there are books out there that do explain this then I am sorry that I have not read it or perhaps I missed that chapter. </p><p> <b>'man perlmodlib' to see what the core modules are</b> </p><p> <b>'perldoc -f insert-function-name'</b> </p><p> <b>'perldoc perl' for a summary list of functions, other perldoc pages and loads of other stuff. Decide what you want to look up and type perldoc perlref for stuff on perl references - easy huh</b> </p><p> <b>'perldoc perltoc' for a an in depth look at everything in Perl</b> </p><p>This is the entrance to Perl, not the back door to be found behind the scullery maid under an aardvark when every other avenue has been exhausted</p><p>Given this revelation on how to find what I wanted to find I took up the editor of choice and started a very simple script. when I got to something that did not compile and I could not figure out why it wouldn't, I could, with confidence go to the 'help system' and find the right syntax etc.</p><p>It then smacked me in the face, I may be wrong but there does not seem to be the same thing in any other system, it may be close but not the same. So why wasn't the 'perldoc how to program like you a have never programmed before even if you have never programmed' message out there. A healthy language needs new recruits and helping them find what and how they can achieve what they want to do is paramount in keeping those new recruits and keeping the language alive. Maybe it is presumed that programmers who are familiar with such things will always read programming books/articles/blogs. Well nobody is born with innate knowledge of a system, they have to learn it and the first thing is to learn how to get help. To a complete novice it is the most important thing to be able to help themselves to help themselves.</p><p>Perldoc is not documentation, yes I know they are documents, it is the help system, and it is there on your machine tailored to the version installed on your machine. It is easy to access anywhere where there is Perl installed - your friend in a box. How cool is that?</p> redspike 2010-02-06T22:52:51+00:00 journal Test::Class::Most http://use.perl.org/~Ovid/journal/40148?from=rss <a href="http://blogs.perl.org/users/ovid/2010/01/-package-sometestclass.html">Test::Class::Most</a>. Ovid 2010-01-31T19:25:10+00:00 journal Testing with PostgreSQL http://use.perl.org/~Ovid/journal/40145?from=rss <p>My new personal project has a PostgreSQL database. <a href="http://blogs.perl.org/users/ovid/2010/01/testing-postgresql.html">Here's how I'm handling testing</a>.</p> Ovid 2010-01-30T16:22:57+00:00 journal Don't let the language dictate your thought processes http://use.perl.org/~redspike/journal/40138?from=rss <b>Don't let the language dictate your thought processes #1</b> <p>The problem I have found of coming to a different discipline (graphics to programming) is that I forgot how I learned the disciplines that I was familiar with in the first place. Today I was able to untangle some of this conundrum.</p><p>It started with the statement 'Don't let the language dictate your thought processes' which is similar to 'Don't let the media mask the message' but in a different guise.</p><p>For a long time I have been trying to understand why I find it difficult to think in Perl or indeed any other language. It all seems so easy when following a tutorial but when I have a problem to solve there did not seem to be any way of starting. I do regular problem solving every day so it is not a strange concept. I can intellectually understand the starting point and what it required and indeed the steps in between. However putting that into practice has prove more elusive than I first would have thought. </p><p>In designing graphics, logos, pictures and stuff I use the shapes as ways of communicating an idea. Someone gives me an outcome they want to achieve and a load of things that vaguely have something to do with it. I ask questions or not and then process the information giving them a graphical representation of the thing they said they wanted to achieve. I have techniques and mental patterns that let me get those odd scribblings or random conversations that people give me to produce something coherent.</p><p>In programming I do the same thing but in information not shapes. The bits of information to me internally have shapes and so I have tried to use the same techniques that I have always used for producing designs. I have struggle to understand why that was not working. The processes all seemed the same but when I came to write the code after making my plan I was always left with the question 'Now what do Ido? An the answer never seemed to come. </p><p>I have accepted up until now that perhaps I just did not have it in me and just to carry on do the odd script and a bit of cut and pasting there. I also accepted the perceived wisdom of the conventions used and best programming practices and all that. When trying to ask for help I have not been able to ask the right question to get the help. Everyone has been as helpful as they can. The most popular answers to my question 'Why don't I get it?' are 'Some people just do and others don't', 'Don't know what you're talking about' and 'I don't know it just happens'. Not a great start.</p><p>I have followed the tutorials and bought and read books by the ton. I have understood them to a certain degree and been able to use what I have learned to do what I have needed to do, but it has been a struggle. I am not averse to hard mental gymnastics however the whole thing is not intuitive for me. So my frustration was knowing that I deal with similar problems and come up with the goods in graphic design and that the mental processes are similar.</p><p>In the explanations and examples that I followed I could see how they got to where they wanted to be but I was unable to allegorically use that pattern to solve another problem. I was being shown one way to do it which is the natural way for that person or is the perceived best convention. There are of course more than one way to do it but I was only being shown one or at least I was not familiar enough to know how to find all the different ways and so I had this seemingly mad idea that I had to fit the whole of Perl into my head before I could do anything. Which of course is madness. Its not the way I approached using computers to do graphic design, I did not understand everything about the programs and processes before I was able to give a printer an eps file which separated the tints out for 2 colour printing that would appear that it was done in 7 colours. </p><p>So how had I got the wrong end of the stick? After I had decided what my program needed to do and mapped it out and then said 'So now what do I do?' I had not been able to get any further, I could not see the next step because I was trying to write Perl in the way that the tutorials and books ahd told me but it is not the way that I can write Perl. On of the reasons using Perl was because I had read at length that it was flexible and there was a myriad of ways to do the same thing. Ah yes unless it seemed you did not think like the people who wrote the tutorials (not a criticism) or that you had not come up through the same paths, which include neural ones too.</p><p>Graphically (image manipulation) my tools are the programs which I had transposed wrongly to be editors in programming (inli&gt; manipulation). This may be correct if I was using a gui development environment but that only allows me to do the things that the program allows me to do not the programming language. Its the tools within the programming language that I needed to be comfortable with, than I would be able to think of a goal and then (as I do in graphics) be able to make that possible with the manipulations of the data. Intellectually of course there is no different but the methods are less so.</p><p>Today I traced the exact process by which I design things both on a drawing board and in a computer environment. I then applied this to the way I have been trying to do the same sort of process in a programming language. I came up with the following plan.</p><ol> <li> Decide what I want to do </li><li> What is the first step? </li><li> How many different ways can I do first step in Perl </li><li> Make a quest to find out all the different ways of doing that first thing which could be for instance getting the inforrmation out of a file. </li><li> Make a choice as to which ones suit me and eventually I will be able to choose the one that is for other reasons too but lets not get ahead of myself </li><li> Apply that method </li><li> Carry on to next step and repeat the process </li></ol><p>So I will start with a simple goal and then go questing, which will give me the broad spectrum of the different ways things can be done to acheive that same goal which in turn allows the language to adapt to my neural pathways. By cracking this nut all the others will be easier and I will not have to get the whole of Perl in my head. What a relief.</p><p>By doing this I will discover all the TMTOWTDI ness that Perl really has and will then understand enough to make my own path through the language to get to the desired outcome. The important thing is that it is my own way, everyone sees the world in a different way and has got to the position that they are now via many different routes and if the way that you are shown something does not fit into that way of thinking then all the book reading in the world will not cure it. Reading the source code as I have been doing has helped me to understand this.</p><p>It may seem blindingly obvious to you but it is not. What I had been doing is trying to make my mind think like Perl or at least he tutorials and not making Perl think like me. I had to learn not to let the language dictate my thought process because Perl can't think but I can. By discovering all the different ways Perl does things I will have a matrix to find my way to the outcome in a way that follows the way I think.</p><p>To the people who could not give me the answer to the question I did not know how to ask I apologise, you could not have understood the question because you have probably not had to ask a similar one yourself or if you did you would not have asked it from where I am. I could tell that from the perplexed expressions on your faces. Yes I can see your expression when you type.</p><p>It is probably just as well to note that the methods by which information is found is as important as the information that is provided, if there is not a track to it you can't visit.</p><p>I chose Perl because it promised that there was more than one way to do it. I took this to apply to every aspect and that it would allow me to do it my way which I will now test. I then got bogged down in doing what convention said because I was learning and thought that it new better but of course it doesn't do it better otherwise we would not improve things or find different ways to do things or find new things to do with the things we already have. I am aware of other considerations like efficiency and refactoring and endless boring list but make the programming language suit you, and if it won't let you do that, ditch it.</p> redspike 2010-01-28T00:46:12+00:00 journal