petdance's Journal http://use.perl.org/~petdance/journal/ petdance's use Perl Journal 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:01:21+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 petdance's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~petdance/journal/ Spiteful spam http://use.perl.org/~petdance/journal/39969?from=rss <p> I know that a lot of people are moving their blogs over to <a href="http://blogs.perl.org/">http://blogs.perl.org/</a>, leaving <a href="http://use.perl.org/">http://use.perl.org/</a> behind. Part of the frustration is that Chris Nandor, Pudge, hasn't done much to modernize use.perl.org, but hey, it's Pudge's choice, and he runs the site, and we're all here by grace of him running it. Beggars and choosers, y'know. If you're frustrated with a Perl news site, you can go <a href="http://perlbuzz.com/">start your own</a>. </p><p> So certainly, I think this spam I just received is just out of line.</p><blockquote><div><p> <tt>From: GreatestColonHealth &lt;Kevin...@...by.com&gt;<br>Subject: With This Astounding Cleanser You May Eliminate Pudge</tt></p></div> </blockquote><p>That's just nasty!</p> petdance 2009-12-01T16:53:59+00:00 journal Rethinking the interface to CPAN http://use.perl.org/~petdance/journal/36073?from=rss <p> <i>I've started a group, <a href="http://groups.google.com/group/rethinking-cpan">rethinking-cpan</a>, for discussing the ideas I've posted here. -- Andy</i> </p><p> Every few months, someone comes up with a modest proposal to improve CPAN and its public face. Usually it'll be about "how to make CPAN easier to search". It may be about adding reviews to search.cpan.org, or reorganizing the categories, or any number of relatively easy-to-implement tasks. It'll be a good idea, but it's focused too tightly.</p><p> <b>We don't want to "make CPAN easier to search." What we're really trying to do is help with the selection process. We want to help the user find and select the best tool for the job.</b> </p><p> It might involve showing the user the bug queue; or a list of reviews; or an average star rating. But ultimately, the goal is to let any person with a given problem find and select a solution. </p><p> "I want to parse XML, what should I use?" is a common question. XML::Parser? XML::Simple? XML::Twig? If "parse XML" really means "find a single tag out of a big order file my boss gave me", the answer might well be a regex, no? Perl's mighty CPAN is both blessing and curse. We have 14,966 distributions as I write this, but people say "I can't find what I want." <a href="http://search.cpan.org/search?query=xml&amp;mode=all">Searching for "XML"</a> is barely a useful exercise. </p><p> Success in the real world </p><p> Let's take a look at an example outside of the programming world. In my day job, I work for <a href="http://flr.follett.com/">Follett Library Resources</a> and <a href="http://www.bwibooks.com/">Book Wholesalers, Inc.</a> We are basically the Amazon.com for the school &amp; public library markets, respectively. The key feature to the website is not ordering, but in helping librarians decide what books they should buy for their libraries. Imagine you have an elementary school library, and $10,000 in book budget for the year. What books do you buy? Our website is geared to making that happen. </p><p> Part of this is technical solutions. We have effective keyword searching, so you can search for "horses" and get books about horses. Part of it is filtering, like "I want books for this grade level, and that have been positively reviewed in at least two journals," in addition to plain ol' keyword searching. Part of it is showing book covers, and reprinting reviews from journals. (If anyone's interested in specifics, let me know and I can probably get you some screenshots and/or guest access.) </p><p> BWI takes it even farther. There's an entire department called Collection Development where librarians select books, CDs &amp; DVDs to recommend to the librarians. The recommendations could be based on choices made by the CollDev staff directly. They could be compiled from awards lists (Caldecott, Newbery) or state lists (the Texas Bluebonnet Awards, for example). Whatever the source, they help solve the customer's problem of "I need to buy some books, what's good?" </p><p> This is no small part of the business. The websites for the two companies are key differentiators in the marketplace. Specifically, they raise the company's level of service from simply providing an item to purchase to actually helping the customer do her/his job. There's no point in providing access to hundreds of thousands of books, CDs and DVDs if the librarian can't decide what to buy. FLR is the #1 vendor in the market, in large part because of the effectiveness of the website. </p><p> Relentless focus on finding the right thing </p><p> Take a look at the <a href="http://flr.follett.com/">front of the FLR website</a>. As I write this, the page first thing a user sees is "Looking for lists of top titles?" That link leads to <a href="http://flr.follett.com/intro/firstchoice_elem_summer08.html">a page of lists for users to browse</a>. Award lists, popular series grouped by grade level, top video choices, a list called "Too good to miss," and so on. The entire focus that the user sees is <b>"How can I help you find what you want?"</b> </p><p> Compare that with <a href="http://search.cpan.org/">the front page of search.cpan.org</a>. Twenty-six links to the categories that link to modules in the archaic Module List. Go on, tell me what's in "Control Flow Utilities," I dare you. Where do I find my XML modules? Seriously, read through all 26 categories without laughing and/or crying. Where would someone find Template Toolkit? Catalyst? ack? Class::Accessor? That one module that I heard about somewhere that lets me access my Lloyd's bank account programtically? </p><p> Even if you can navigate the categories, it hardly matters. Clicking through to the category list leads to a one-line description like "Another way of exporting symbols." Plus, the majority of modules on CPAN are not registered in the Module List. The Module List is an artifact a decade old that has far outlived its original usefulness. </p><p> What can we do? </p><p> There have been attempts, some implemented, some not, to do many of these things that FLR &amp; BWI do very effectively. We have CPAN ratings and keyword searching, for example. BWI selects lists of top books, and <a href="http://www.nntp.perl.org/group/perl.module-authors/2008/04/msg6386.html">Shlomi Fish has recently suggested</a> having reviews of categories of modules, which sounds like a great idea. I made a <a href="http://perl101.org/how-do-i.html">very tentative start on this on perl101.org</a>. But it's not enough. </p><p> We need to stop thinking tactical ("Let's have reviews") and start thinking ("How do we get the proper modules/solutions in the hands of the users that want them.") Nothing short of a complete overhaul of the front end of the CPAN will make a dent in this problem. <b>We need a revolution, not evolution, to solve the problem</b>. </p> petdance 2008-04-06T07:04:18+00:00 journal ack 1.78 is out http://use.perl.org/~petdance/journal/35972?from=rss <p> After three months of lots of development work and intermediate releases, I've released <a href="http://petdance.com/ack/">ack 1.78</a>. There are tons of new features and lots of compatibility fixes for Windows. ack is a replacement for grep that is geared to working with trees of code. </p><p> Highlights in this release include: </p><ul> <li>Files specified on the command line are always searched, even if they don't match a known filetype</li><li>Ability to ignore directories</li><li>Pager support</li><li>More flexible grouping options</li><li>Many more languages recognized and existing ones improved, including CFMX, Actionscript, assembly, Tcl, Lisp, Smalltalk</li> <li>Ability to define your own languages based on filetype</li></ul><p> ack may well change the way you work on the command-line with source code. Try it out and let me know what you think. You can install it by installing App::Ack from CPAN, or downloading the standalone version to your ~/bin directory. </p> petdance 2008-03-25T03:45:57+00:00 journal Who will take over perl101.org? http://use.perl.org/~petdance/journal/35826?from=rss <p> Who out there has some free time and is interested in helping out beginners? </p><p> My little project for Perl beginners, <a href="http://perl101.org/">Perl101.org</a>, has been largely ignored lately. My idea was to have a cookbooky style set of pages that beginners could read for things like the right way to get a count of elements in an array, or how to extract links from a web page without using a regular expression. </p><p> It started out pretty nicely, but has lain fallow for months now. I'd like it if someone could take it over. I'll hand over the domain name and <a href="http://code.google.com/p/perl101/">the Google Code project</a> for the site, and you'll keep this going and make it something more useful. If you want to overhaul how it works, or keep the same system going, it doesn't matter to me. All I require is that you'll do something useful for the beginners. </p><p> Any interest? </p> petdance 2008-03-03T16:26:23+00:00 journal Perl gratitude, 2007 http://use.perl.org/~petdance/journal/34957?from=rss <p> Here in the US, it's Thanksgiving, a day of eating lots of food, watching football, and sometimes, just sometimes, expressing gratitude and giving thanks for those things that make life wonderful. </p><p> Here are the things I'm grateful for in late 2007, in no particular order after the first. </p><p> Google Code </p><p> <a href="http://code.google.com/hosting/">Google's project hosting service</a> has been a godsend. It's changed the way I do open source projects. It has leapfrogged SourceForge for ease of maintenance, and the bug tracker trumps <a href="http://rt.cpan.org/">RT for CPAN</a> that we've been using for so long. Add that to the integration with Google Groups which makes it trivial to create mailing lists, and it's at the tops of my list for 2007. I can't say enough good about it.</p><p> The readers of Perlbuzz </p><p>Eleven weeks ago, Skud and I started this little website called <a href="http://perlbuzz.com/">Perlbuzz</a> as an alternative to the "more traditional outlets" for news in the Perl world. The response has been tremendous. We get 600 RSS readers every day, and have had over 10,000 unique visitors in that time. It makes me happy that our little venture is used and appreciated by the community.</p><p> Test::Harness 3.0 </p><p>It's been over a year in the making, but the new version of <a href="http://search.cpan.org/dist/Test-Harness/">the crucial Test::Harness 3.0</a> means more flexibility for module authors, and lots of UI improvements for people who just want to run <i>prove</i> and <i>make test</i>.</p><p> Mark Dominus </p><p>MJD is so much a fixture in Perl it's easy to forget that he's there. For 2007, though, never mind all the things he's done for Perl in the past, or the hours I've spent being enthralled in talks of his. His <a href="http://blog.plover.com/">Universe Of Discourse blog</a> is the single most intelligent blog out there, and sometimes it just happens to be about Perl.</p><p> Andy Armstrong </p><p>Was Andy Armstrong always around, or did I just not notice? His time and dedication spent on climbing on board with Ovid and Schwern and the rest of the Test::Harness 3.0 crew has been invaluable in getting it out. Plus, he's a really swell guy anyway. </p><p> Dave Hoover </p><p>When I finally despaired of the amount of time and frustration it took to organize content for <a href="http://chicago.pm.org/">Chicago.pm</a>'s Wheaton meetings, Dave Hoover stepped up and volunteered to take it over. I'm thankful, but not as much as I hope the other Chicago.pm folks are.</p><p> Perl::Critic </p><p>I'm all about having the machine keep an eye out for the stupid things we do, and the goodness of <a href="http://perlcritic.tigris.org/">Perl::Critic</a> is always impressive. You won't like everything Perl::Critic says about your code, but that's OK. It's an entire framework for enforcing good Perl coding practices.</p><p> The Perl Community in general </p><p>The Perl community is populated by some tremendous folks. Some names are more known than others, but these people help make daily Perl life better for me. In no particular order, I want to single out Pete Krawczyk, Kent Cowgill, Elliot Shank, Liz Cortell, Jason Crome, Yaakov Sloman, Michael Schwern, Andy Armstrong, Ricardo Signes, Julian Cash, Jim Thomason, chromatic, Chris Dolan, Adam Kennedy, Josh McAdams and of course Kirrily Robert. If you think you should be on this list, you're probably right, and I just forgot. </p><p> My wife, Amy Lester </p><p>Because even if she doesn't understand this part of my life, she at least understands its importance to me.</p><p> I'd love to hear back from anyone about what they're thankful for. I'm thinking about having a regular Perlbuzz "Love Letters to Perl" column where people write about what they love in Perl. </p> petdance 2007-11-22T19:00:35+00:00 journal ack 1.70 adds context and line-specific matching http://use.perl.org/~petdance/journal/34832?from=rss <p> ack, my replacement for grep for 95% of the times programmers use grep, just got <a href="http://search.cpan.org/dist/ack">released to CPAN with version 1.70</a>. </p><p> At long last, you can now get contextual lines before and after matched lines, just like GNU grep's -A, -B and -C options. You can also match on a specific line number or range of line numbers with the new --line option. For example, if you want to see the first line of every Perl file in a tree, you'd just do <tt>ack --line=1 --perl</tt>. Thanks very much to Torsten Biix for putting both these features together for me.</p><p> Finally, Elliot Shank pointed out that one of my favorite features, the <tt>-1</tt> option, was never documented. Now it is. The <tt>-1</tt> option says "stop after the first match of any type." If you find yourself acking for lines, or searching for a specific file with <tt>ack -g</tt> and then having to Ctrl-C to stop the search process, just add a <tt>-1</tt> and Ctrl-C no longer. </p><p> ack is available in the <a href="http://search.cpan.org/dist/ack">ack distribution</a> on CPAN, or by installing the module App::Ack from the CPAN shell. You can also download the <a href="http://ack.googlecode.com/svn/tags/latest/ack-standalone">single-file version</a> direct from Subversion and drop it right into your ~/bin directory.</p> petdance 2007-11-05T03:50:08+00:00 journal New WWW::Mechanize and Test::WWW::Mechanize spiffiness http://use.perl.org/~petdance/journal/34802?from=rss For those of you using Mech for your testing of your website:<blockquote><div><p> <tt>&nbsp; &nbsp; $agent-&gt;content_contains( qr/\QEnter keyword(s)/ )<br>&nbsp; &nbsp; &nbsp; &nbsp; or $agent-&gt;dump_all( \*STDERR );<br> <br>not ok 14 - Content contains '(?-xism:Enter\ keyword\(s\))'<br>#&nbsp; &nbsp;Failed test 'Content contains '(?-xism:Enter\ keyword\(s\))''<br>#&nbsp; &nbsp;at t/simple-search.t line 31.<br>#&nbsp; &nbsp; &nbsp;searched: "&lt;HTML&gt;\x{0a}&lt;HEAD&gt;\x{0a}&lt;TITLE&gt;TitleTales&amp;#153;&lt;/TITLE&gt;&lt;/HEA"...<br>#&nbsp; &nbsp;can't find: "(?-xism:Enter\ keyword\(s\))"<br>/buttonsd/bisac2.gif<br>/graphics/bar.gif<br>POST http://hoops.flr.follett.com:2112/simpsearch.php [simsearch]<br>&nbsp; clickval=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (hidden readonly)<br>&nbsp; searchwords=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(text)<br>&nbsp; S=&lt;UNDEF&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (checkbox) [*&lt;UNDEF&gt;/off|on/Include Out of Print / Please Order Direct Titles]</tt></p></div> </blockquote><p>No longer do you have to do a $mech-&gt;save_content() and then run mech-dump on it. How has it taken me so long to put this stuff in there?</p> petdance 2007-10-31T17:13:56+00:00 journal Evolution requires mutation http://use.perl.org/~petdance/journal/34662?from=rss <p>(Originally posted at <a href="http://perlbuzz.com/2007/10/evolution-requires-mutation.html">http://perlbuzz.com/2007/10/evolution-requires-mutation.html</a>)</p><p> In the past couple of days, I've seen some counterproductive social behaviors that help scare away community members and lead to boring monoculture: Taking a public dump on the projects of others when they do not directly affect you. It's rude, it discourages future risk taking in everyone, it goes against the very nature of open source that has brought us here today, and it leads to monoculture. I'd like people to stop. </p><p> Mutation #1: kurila </p><p> Gerard Goossen recently released <a href="http://search.cpan.org/dist/kurila/">kurila</a>, a fork of Perl 5 that includes some speedups and tweaks that seem to scratch Gerard's itches, as well as bundling extra modules. I'm right now trying to get an interview with him to find out more about his project and the reasons behind it, because there are probably some interesting lessons in there. However, the disapproval on the Perl 5 Ports list was swift and severe. </p><blockquote><div><p> All forking based on the Perl 5 syntax and code base, throwing away CPAN compatibility, seems to me to be a complete worthless waste of time.</p></div> </blockquote><p> So what? Who is anyone to say how Gerard is to use his time? Is there any harm here? No? Then leave the guy alone, please. </p><p> Mutation #2: lambda </p><p> Eric Wilhelm released <a href="http://search.cpan.org/dist/lambda/">lambda</a>, a distribution that lets you use the Greek character lambda (&#955;) as an alias for <tt>sub {...}</tt>, apparently as a nod to Python's <tt>lambda</tt> keyword for anonymous functions. Immediately people jumped on him saying that the module should go into the Acme:: namespace, as if the namespaces of CPAN mean anything in 2007. There was also this cluck-cluck from someone I figured would be more encouraging (and later apologized, as it turns out): </p><blockquote><div><p> Well, if you want to use it in your own code and your work's code, that's fine (because I'm sure you find typing CONTROL-SHIFT-EL so much easier than "sub {}"<nobr> <wbr></nobr>:) but if it shows up in your CPAN modules, you might get a few complaints since this sugar, while a really nifty hack, adds nothing complex but does screw up older editors and will confuse the heck out of a lot of maintenance programmers.</p></div> </blockquote><p> Personally, I figure that if someone's a smart enough programmer to do a hack like the lambda module, he or she is also smart enough to figure out potential downsides. And so what if he doesn't? What's the harm here? </p><p> Mutation #3: perlbuzz </p><p> <a href="http://perlbuzz.com/">Perlbuzz</a> itself has always come under this umbrella of disapproval. Even before we announced the site, Skud and I have fended off the comments saying "We already have <a href="http://use.perl.org/">use.perl.org</a>, we don't need Perlbuzz." Maybe not, but why do you care if we start the site? Why does it bother you? And why do you find it necessary to tell us that we're embarking on a waste of time? </p><p> I hope that in the past few months, the work that Skud and I have done have shown you, the reader, that Perlbuzz is a worthwhile addition to the Perl community, and a valuable news source that overlaps other news sources while not being a subset. What if Skud and I had listened to the <i>tsk tsk</i> of the doubters? Perl would be right where we it was before, with nothing new. </p><p> Evolution requires mutation </p><p> Why are we so quick to take a dump on the projects of others? The only way anything interesting happens is that people try weird, new things and see what sticks. What if Larry had listened to those way back when who said "Ah, we've got Awk and shell tools, we don't need Perl?" </p><p> I fear our tendency to monoculture. I want crazy new projects to thrive, not get squashed at their very infancy. Next time someone comes out with a project that you think is silly, congratulate the person rather than scoffing at it. Who knows what it might lead to? </p><p>(And a big thank you to Jim Brandt for the "Evolution requires mutation" idea.)</p> petdance 2007-10-12T15:51:54+00:00 journal Today's snazzy ack trick http://use.perl.org/~petdance/journal/34213?from=rss I'm going through a codebase that's got a ton of unused files that have never been pruned. I use <a href="http://petdance.com/ack/">ack</a> to look to see if a given file is used, and if not, <tt>svn rm</tt> the sucker. Then the domino effect starts. Removing that file means that there may well be others, both HTML and graphic, that are no longer used, too. Here's my handy tool to make that easier:<blockquote><div><p> <tt>svn diff | grep ^- | ack '(href|src)="(.+?)"' --output='$2' | sort -u</tt></p></div> </blockquote><p>Get the diff, only look at the lines where something's been removed, then find href= or src=, and only show what's in the parens, then sort and dedupe. Voila!</p> petdance 2007-08-25T03:56:24+00:00 journal Perl security done right http://use.perl.org/~petdance/journal/34073?from=rss I just read the security chapter in <i>Mastering Perl</i>. It should be required reading for anyone who does any Perl programming for the web. brian's discussion of tainting is the best I've seen yet. I only wish he'd mentioned tainting and DBI. petdance 2007-08-10T15:00:29+00:00 journal Hello to Technorati http://use.perl.org/~petdance/journal/33949?from=rss <a href="http://technorati.com/claim/b7jxdxfb7d">Technorati Profile</a> <p> This is to let Technorati know that I actually write this. </p><p> I guess I should put real content here. Here's some: </p><p> <b>Use ack! Use ack!</b></p> petdance 2007-08-01T17:02:20+00:00 journal how to get help wanted ads http://use.perl.org/~petdance/journal/33912?from=rss I'd like to see some sort of "Help Wanted" or "Help Available" board that would let people post their projects that they need help on, or where people could say "I have these skills, I'd like to help on a project." <p> I'm almost thinking it'd be a wiki, but it could also be like jobs.perl.org. I very specifically do not it to be "Just post to your use.perl journal", because not everyone reads everyone's use.perl journal, and plus I want to be able to post new people who are eager to help on something to a dedicated place where their skills could get used. </p><p> Thoughts?</p> petdance 2007-07-29T20:39:20+00:00 journal What should I work on for the hackathon? http://use.perl.org/~petdance/journal/33615?from=rss I'm taking part in the post-YAPC::NA hackathon remotely on Thursday and Friday. Took two days off of work and I'm going to do nothing but work on Perl-related projects. Here's what's big in my iGTD to-do list: <ul> <li> Move the Parrot wiki at rakudo.org off of Socialtext onto MediaWiki </li><li> Get context searching working in ack </li><li> Fix the bug where <tt>ack -1</tt> fails to find "-1" </li><li> Write docs for the headerizer in Parrot </li><li> Write a doc generator for Parrot </li><li> Write ack -g so you don't have to do <tt>ack -f | grep whatever </tt></li> <li> Move WWW::Mechanize's repository over to Google Code </li><li> Update Parrot coding standards </li><li> Fix Parrot's C macros that (dangerously) assume certain variables in scope </li><li> Work on Solaris lint target for Parrot </li><li> Work on splint target for Parrot </li></ul><p> Which of those do you want me to work on? Why?</p> petdance 2007-06-27T18:22:26+00:00 journal Prepare for consting! http://use.perl.org/~petdance/journal/33354?from=rss Note that I am officially jumping back on the Parrot project. <p> All your consts are belong to me.</p> petdance 2007-05-25T22:30:40+00:00 journal Help test WWW::Mechanize and its encoding fixes http://use.perl.org/~petdance/journal/33338?from=rss Kevin Falcone and I have been working on encoding problems with Mechanize. As many people as can test the darn thing would be appreciated. <p> Also, suggestions on getting rid of the warnings in the test suite are welcome as well. </p><p> Thanks,<br> xoxo,<br> Andy<br> (and Kevin) </p><p> Download at $CPAN/authors/id/P/PE/PETDANCE/WWW-Mechanize-1.29_01.tar.gz </p><p> Here's what goes wrong: <code> t/live/wikipedia.........ok 5/15Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. t/live/wikipedia.........ok 10/15Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at<nobr> <wbr></nobr>/Library/Perl/5.8.6/darwin-thread-multi-2level/HTML/PullParser.pm line 83. t/live/wikipedia.........ok </code></p> petdance 2007-05-22T19:45:46+00:00 journal Source code comment of the day http://use.perl.org/~petdance/journal/33161?from=rss <code> # Oh look, a yawning portal to Hell! Let's play touch football right by it! </code> <p> <a href="http://search.cpan.org/src/ARANDAL/Pod-Simple-3.05/lib/Pod/Simple/HTML.pm">http://search.cpan.org/src/ARANDAL/Pod-Simple-3.05/lib/Pod/Simple/HTML.pm</a></p> petdance 2007-04-30T22:23:48+00:00 journal My new old job http://use.perl.org/~petdance/journal/33102?from=rss I've got a new job. I'm no longer at <a href="http://socialtext.com/">Socialtext</a> doing wikis, but am back at <a href="http://www.flr.follett.com/">Follett Library Resources</a>. <p> I used to be the manager of the Development department here at FLR, but now I'm just a plain ol' Senior Programmer. The current manager is a guy I hired years ago who is a great leader, and a natural for the position, and so working for him, with our roles reversed, is no trouble whatsoever. It's great to work in a company again with real management. </p><p> My mom asked me "Do you like not having the boss responsibilities? Do you have aspirations to move up again?" I really don't see my move back here as "down". It's just a different role. When I took the manager job, it wasn't because I wanted to move "up", but because it was part of what I needed to do to make things happen. I had to hire people to make the department better, and I needed to be the technical leader. After five years of getting the department into shape, I had come to the end of what I wanted to do, so I left. Now that I'm back, it's with a new set of challenges, leading work on a new project overhauling a website for a sister company, doing new cleanup and refactoring.</p> petdance 2007-04-25T18:31:02+00:00 journal Allison on commit bits http://use.perl.org/~petdance/journal/32852?from=rss "I generally find that the people with the greatest dislike of a waiting period for commit access are the ones with the greatest need of a waiting period for commit access." petdance 2007-03-31T05:26:37+00:00 journal Please stop telling me about xkcd http://use.perl.org/~petdance/journal/32426?from=rss Every time xkcd.com mentions Perl, I get a half dozen forwards, and a half dozen people feel obligated to post it to their local Perl Mongers list. No more! Agh! petdance 2007-02-16T17:14:58+00:00 journal ... that rhymes with "P" and that stands for "POOL"! http://use.perl.org/~petdance/journal/32370?from=rss Here's an entry at dirtydictionary.com for the term "pocket pool". (No nudity, but may not be SFW) <p> <a href="http://www.dirtydictionary.com/pocketpool.html">http://www.dirtydictionary.com/pocketpool.html</a> </p><p> And who's that in the photo? Who could it be? Is it that surprising? I say not!</p> petdance 2007-02-11T06:00:22+00:00 journal February Chicago.PM: It's a dynamic language hootenanny http://use.perl.org/~petdance/journal/32287?from=rss Chris McAvoy will be rounding up the big four dynamic languages in a rootin'-tootin' look at what's what in the world of Perl, PHP, Python and Ruby. Is PHP just for script-slinging marketdroids? Do Python's whitespace rules really suck as much as you'd think? Is Ruby more than Rails? What can we learn from them for Perl? <p> Chris promises to make this a no-BS, no-bashing, honest look at the strengths and weaknesses of each of these languages. Come with an open mind and we'll explore the limitless frontiers of awesome programming. </p><p> Chris will be presenting both in the city and the suburbs this month: </p><ul> <li> <a href="http://rakudo.org/chicago-pm/index.cgi?2007_02_13_dynamic_language_hootenanny"> in Wheaton at IIT Rice campus on Feb 13, 2007</a> </li><li> <a href="http://rakudo.org/chicago-pm/index.cgi?2007_02_27_dynamic_language_hootenanny">in Chicago at Performics on Feb 27, 2007</a></li> </ul><p> Come on out and learn some new tricks!</p> petdance 2007-01-31T05:08:29+00:00 groups I'm so proud http://use.perl.org/~petdance/journal/31827?from=rss <p> I'm so proud. Two of my modules are in the 2006 Perl Advent Calendar: </p><p> <a href="http://perladvent.pm.org/2006/5/">http://perladvent.pm.org/2006/5/</a> ack<br> <a href="http://perladvent.pm.org/2006/6/">http://perladvent.pm.org/2006/6/</a> Module::Starter</p> petdance 2006-12-06T20:56:29+00:00 journal Socialtext hackathon 12/6/2006 http://use.perl.org/~petdance/journal/31818?from=rss <p> Wednesday, December 6th is Wiki Hackathon day, at the home office of my employer, Socialtext. </p><p> Join us from remote or in our offices in Palo Alto to hack your Wiki project to your heart's content. We'll showcase all projects on this site and elsewhere, provide beer and pizza, and might even have some nifty giveaways for the day's coolest hacks. Virtual participants can join us in IRC channel <a href="irc:ircfreenodenetsocialtext">#socialtext on irc.freenode.net</a>. Visit the wikithon workspace at <a href="http://www.socialtext.net/wikithon">http://www.socialtext.net/wikithon</a>.</p> petdance 2006-12-06T03:05:33+00:00 journal Top 10 reasons to use ack http://use.perl.org/~petdance/journal/31763?from=rss Yesterday I posted about <a href="http://use.perl.org/~petdance/journal/31757">a snazzy trick with ack</a>, but people pinged me asking what ack is and why they should use it. <p> ack is the replacement I wrote for grep, aimed at large trees of heterogeneous code. </p><p> Using it will change your life, but why? Here's my top 10 list: </p><ol> <li>Searches recursively through directories by default, while ignoring<nobr> <wbr></nobr><tt>.svn</tt>, <tt>CVS</tt> and other VCS directories. <ul> <li>Which would you rather type?<br> <tt>$ grep pattern $(find . | grep -v<nobr> <wbr></nobr>.svn)</tt> <br> <tt>$ ack pattern</tt> </li></ul></li> <li>ack ignores most of the crap you don't want to search <ul> <li>VCS directories</li> <li> <i>blib</i>, the Perl build directory</li> <li>backup files like <i>foo~</i></li> <li>binary files</li> </ul></li> <li>Lets you specify file types to search, as in <tt>--perl</tt> or <tt>--nohtml</tt>. <ul> <li>Which would you rather type?<br> <tt>$ grep pattern $(find . -name '*.pl' -or -name '*.pm' -or -name '*.pod' | grep -v<nobr> <wbr></nobr>.svn)</tt> <br> <tt>$ ack --perl pattern</tt> </li></ul><p> Note that ack's <tt>--perl</tt> also checks the shebang lines of files without suffixes, which the find command will not.</p></li> <li>File-filtering capabilities usable without searching with <tt>ack -f</tt>. Want a list of all Perl files in a tree? Use <tt>ack -f --perl</tt>.</li> <li>Color highlighting of search results.</li> <li>Uses real Perl regular expressions, not a GNU subset.</li> <li>Allows you to specify output using Perl's special variables <ul> <li>Example: <tt>ack '(Mr|Mr?s). (Smith|Jones)' --output='$&amp;'</tt></li> </ul></li> <li>Many command-line switches are the same as in GNU grep:<br> <tt>-w</tt> does word-only searching<br> <tt>-c</tt> shows counts per file of matches<br> <tt>-l</tt> gives the filename instead of matching lines<br> etc.</li> <li>ack is pure Perl, so consistent across all platforms.</li> <li>Command name is 25% shorter.<nobr> <wbr></nobr>:-) Heck, it's 50% shorter compared to <tt>grep -r</tt>.</li> </ol><p> To install it, install the Perl module App::Ack. Your coding life will never be the same. </p><p> Visit the home page at <a href="http://petdance.com/ack">http://petdance.com/ack</a></p> petdance 2006-11-30T04:53:40+00:00 journal Today's handy ack trick http://use.perl.org/~petdance/journal/31757?from=rss <blockquote><div><p> <tt>andy@mel[~/src/st/trunk]$ ack -w 'XXX|REVIEW|FIXME' -o | sort | uniq -c<br>&nbsp; 37 FIXME<br> 180 REVIEW<br> 674 XXX</tt></p></div> </blockquote><p>What, you don't know what ack is? Get to <a href="http://petdance.com/ack">http://petdance.com/ack</a> and install it now. Even better, just do this:</p><blockquote><div><p> <tt>sudo cpan App::Ack</tt></p></div> </blockquote> petdance 2006-11-29T19:37:10+00:00 journal New Text::Balanced removes $&amp; http://use.perl.org/~petdance/journal/31684?from=rss Over in the land of Socialtext Open, we found that we were having big slowdowns because of <tt>$&amp;</tt> somewhere in the code base. Turns out it was in Text::Balanced. I fired off mail to Damian and within half an hour he'd put out a new version that didn't use the evil variable. <p> If you don't know why $&amp; is bad, see the docs for Devel::SawAmpersand. <a href="http://search.cpan.org/dist/Devel-SawAmpersand/">http://search.cpan.org/dist/Devel-SawAmpersand/</a></p> petdance 2006-11-21T23:23:15+00:00 journal Anti-Perl FUD http://use.perl.org/~petdance/journal/31661?from=rss James Keenan has posted an interesting question on his journal about <a href="http://use.perl.org/~kid51/journal/31660">dealing with the Anti-Perl people out there</a>. petdance 2006-11-19T17:43:27+00:00 journal Krugle at the Chicago Hackathon http://use.perl.org/~petdance/journal/31370?from=rss The Chicago Hackathon (<a href="http://hackathon.info/">http://hackathon.info</a>) is excited to have Krugle part of the proceedings. Krugle (<a href="http://krugle.com/">http://krugle.com</a>) is a search engine for source code, projects, and technical information across the web, and they want your feedback. The Krugle team wants to hear from Perl programmers about how Krugle can be more useful to the Perl community. <p> On Saturday, Krugle will be hosting a demo of Krugle, as well as feeding us pizza. They're looking for content advisors, feature feedback, and other interesting ideas. If you're interested, plan on stopping in the main meeting room. If you're not, just come by, grab some pizza, and head back to hacking. </p><p> Ken Krugler, the founder, will be hosting the demo and conversation. He first cut his coding teeth in the Lisa/Mac vortex, and then spent 15 years solving I18N problems. For the past 18 months he's been obsessing about exploratory vertical search for code. In his spare time, he fiddles with cellular automata.</p> petdance 2006-10-20T19:21:22+00:00 news WWW::Mechanize tries to support REST http://use.perl.org/~petdance/journal/31045?from=rss I've had to do some REST work and I was shocked to see that LWP::UserAgent doesn't have a put() method for doing PUT calls. <p> Until Gisle puts it in there for us, I've added one to WWW::Mechanize 1.21_01, which I just put up on CPAN.</p> petdance 2006-09-18T22:22:48+00:00 journal HTML::Tidy overhaul work is commencing http://use.perl.org/~petdance/journal/31042?from=rss Jonathan Rockway, Robert Bachmann and I are starting work in earnest on making HTML::Tidy better, mostly setting up access to much of the tidy API. <p> <a href="http://code.google.com/p/html-tidy/">http://code.google.com/p/html-tidy/</a> is the project home page. We have a mailing list set up there, and the Subversion repository is hosted at Google as well.</p> petdance 2006-09-18T15:17:06+00:00 journal