broquaint's Friends' Journals
http://use.perl.org/~broquaint/journal/friends/
broquaint's Friends' use Perl Journalsen-ususe 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:21:34+00:00pudgepudge@perl.orgTechnologyhourly11970-01-01T00:00+00:00broquaint's Friends' Journalshttp://use.perl.org/images/topics/useperl.gif
http://use.perl.org/~broquaint/journal/friends/
ah, dreams...
http://use.perl.org/~Matts/journal/40130?from=rss
<p>I just woke from a dream where it was rjbs' birthday and we got him an onion cake. Only the person who made the cake misunderstood, and instead of a cake shaped like an onion he cooked it WITH onions in it.</p><p>Bizarro.</p>Matts2010-01-26T10:31:17+00:00journalTime::Piece test failures on Win32
http://use.perl.org/~Matts/journal/40129?from=rss
<p>Can someone with Time::Piece test failures on Win32 please contact me offlist? I have a proposed patch I'd like to test, but no Win32 perl to test it on.</p>Matts2010-01-25T23:23:53+00:00journalWarning compiling perl stuff on Snow Leopard
http://use.perl.org/~Matts/journal/40075?from=rss
<p>I've searched but can't find any reference to this...</p><p>Compiling IO::KQueue on Snow Leopard I get the following warning:</p><blockquote><div><p> <tt>KQueue.xs: In function 'XS_IO__KQueue_kevent':<br>KQueue.xs:71: warning: format not a string literal and no format arguments</tt></p></div> </blockquote><p>Yet that line is just:</p><blockquote><div><p> <tt> Newxz(ke, max_events, struct kevent);</tt></p></div> </blockquote><p>Which seems to me pretty standard perl, and no format strings involved (though Newxz expands quite a few macros).</p>Matts2010-01-04T22:13:57+00:00journalToggle between if/endif in Vim with %
http://use.perl.org/~jmcnamara/journal/39580?from=rss
Dera Lazyweb,
<p>
In vi/vim is it possible to match if/endif in a non-standard language so you can toggle between them using %? I know that this feature is usually reserved for parentheses and braces but this particular language doesn't use them.
</p><p>
I can see, from reading around, that you can set regions via ":syntax region" but I'm not sure if that applies to this case.
</p><p>
I am not a vi user. I'm asking mainly for a colleague.
</p><p>
John.<br>
--</p>jmcnamara2009-09-04T11:15:58+00:00journalPod to Textile for Wikis on Github
http://use.perl.org/~jmcnamara/journal/39555?from=rss
As a mentioned <a href="http://use.perl.org/~jmcnamara/journal/39545">recently</a> I added Pod to Textile support to Pod::Simple::Wiki. It is now up on <a href="http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/lib/Pod/Simple/Wiki.pm">CPAN</a>.
<p>
This lets you to convert a Pod document to Textile markup as follows:</p><blockquote><div><p> <tt>pod2wiki --style=textile Some::Module.pm > some_module.wiki</tt></p></div> </blockquote><p>Which makes it easy to add a github wiki page like <a href="http://wiki.github.com/jmcnamara/pod-simple-wiki/pod2wiki">this</a>.
</p><p>
John.<br>
--</p>jmcnamara2009-08-29T22:15:40+00:00journalInstalling Snow Leopard
http://use.perl.org/~jmcnamara/journal/39550?from=rss
<p>
I installed Snow Leopard and everything went okay. As usual the first thing that I do on an OS is to check the perl version:</p><blockquote><div><p> <tt>$ perl -v<br> <br>This is perl, v5.10.0 built for darwin-thread-multi-2level</tt></p></div> </blockquote><p>Good start.
</p><p>
A few things that didn't work straight away were Apache (dav_svn_module was the culprit, probably the wrong version), make (I needed to install the developer tools separately) and Adblock in Safari (only works in the 32 version).
</p><p>
Apart from that everything looks good.
</p><p>
John.<br>
--</p>jmcnamara2009-08-29T08:58:35+00:00journalSpreadsheet::ParseExcel on github
http://use.perl.org/~jmcnamara/journal/39545?from=rss
<p>
I've moved Spreadsheet::ParseExcel to github: <a href="http://github.com/jmcnamara/spreadsheet-parseexcel/tree/master/">http://github.com/jmcnamara/spreadsheet-parseexcel</a>
</p><p>
It had previously been on Google Code but I didn't find it conducive to collaboration. Hopefully github will be better. I already like the clean look and feel.
</p><p>
One of the default options on github is to have a wiki page which I thought would be useful for the Pod documentation if it were converted to the Textile format. Then I thought "I have a module for that", <a href="http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/lib/Pod/Simple/Wiki.pm">Pod::Simple::Wiki</a>.
</p><p>
So I imported Pod::Simple::Wiki to github, cloned it, followed <a href="http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/lib/Pod/Simple/Wiki/Template.pm"> my own instructions</a>, and within a hour I had a <a href="http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/bin/pod2wiki">pod2wiki</a> Textile converter (with tests).
</p><p>
Here are example pages for <a href="http://wiki.github.com/jmcnamara/spreadsheet-parseexcel">Spreadsheet::ParseExcel</a> and <a href="http://wiki.github.com/jmcnamara/pod-simple-wiki">Pod::Simple::Wiki</a> itself. I'll upload it to CPAN once I make a few more changes to the docs and to link handling.
</p><p>
John.<br>
--</p>jmcnamara2009-08-28T11:07:41+00:00journalEarly Komodo Edit review
http://use.perl.org/~Matts/journal/39063?from=rss
<p>Recently I started using Komodo Edit (the free version of Komodo IDE). This is an early review, of having used it for my work for about a week, which isn't really enough to know whether I'll be sticking with it, but it's a good start. I started to get a bit tired of the limitations of TextMate - an editor I like, and paid for, but the v2 which they keep hinting at seems to never be coming, and it has some short-falls which I find very annoying.</p><p>ActiveState actually asked me to do a review of Komodo IDE a while ago and I never got around to it, so I never got a free license key from them. Maybe they'll read this<nobr> <wbr></nobr>;-)</p><p>This review is of using it on my MacBook (non-pro) 2.4Ghz, 4GB Ram.</p><p>The Good<br>========</p><p>Generally it has everything I'm looking for:</p><p>- all documents in tabs<br>- mostly the right keystrokes for everything (i.e. it's not VI or Emacs, though I believe it has vi emulation for the die-hards) - I only had to fix Cmd-[ and Cmd-] for indent/deindent.<br>- open over scp/sftp.<br>- syntax highlighting seems to just work (haven't found any flaws yet, though Perl can be tricky that way!).<br>- shows line numbers, folds, etc in a nice way<br>- autoindent mostly works well<br>- macros in Javascript/Python make it VERY flexible<br>- "show current file changes" (before you save) is an AWESOME feature, and loads them into the proper "diff" window<br>- macros even allow you to access that diff window, so writing some macros to access our version control system (AccuRev - don't ask!) was relatively straightforward for a non-Javascript coder like myself<br>- macro output looks like it'll be easy enough to write a Prove/Test.pm runner</p><p>The Missing<br>===========</p><p>There are always things missing in editors, usually things I've experienced elsewhere that I'd love to see replicated:</p><p>- I *love* textmate's ability to re-indent code when I paste it in, at the correct current level.<br>- I wish open over sftp would allow me to open a whole directory (i.e. treat it like a temporary project)<br>- I wish I could open a directory instead of have to create a project.<br>- I wish tabs would double over instead of flow off the side (as an option) as I tend to keep a lot of files open<br>- I wish the project pane would highlight the current file/tab instead of the last file I double clicked on<br>- Documentation of the macro stuff is a bit weak, though the forums are good for help on this (I haven't posted, but the search has helped a lot, and most posts seem to get a reply).</p><p>The Buggy/Broken Bits<br>=====================</p><p>- There's sometimes an oddness with macros - sometimes I edit them and the edits don't "take" - restarting fixes this.<br>- Can be a TINY bit slow. I'm on a fast mac, so I suspect this would be much worse on my G4 laptop.<br>- The find options seem a bit odd to me - there's multiple locations for "find" - in the toolbar and in a separate window, be nice if it were unified and accessible with Cmd-F<br>- Open over sftp seemed a bit fragile and has hung on me once</p><p>Overall though, I like it. I'm not really sure what Komodo IDE could add over and above this, I suspect it'll just come with a lot of cool plugins and macros that do clever things...</p><p>I'll maybe post more on this if I keep using it.</p>Matts2009-06-02T00:05:35+00:00journalI'm Off
http://use.perl.org/~davorg/journal/38996?from=rss
<p>For pretty much the same reasons that you've heard from many other people, I've decided to take my Perl blogging elsewhere.</p><p>You'll find me over at <a href="http://perlhacks.com/">Perl Hacks</a>.</p>davorg2009-05-18T20:07:54+00:00journalYAPC::Europe Talk Proposals
http://use.perl.org/~davorg/journal/38903?from=rss
<p>The CFP for this year's <a href="http://yapceurope2009.org/">YAPC::Europe</a> closed yesterday. Usually this means I have a frantic couple of hours rushing around proposing (semi-)random talks. This year I've been a bit more organised and have been proposing talks as they have occured to me. The upside of this is that I have confidence that they will all be interesting talks. The downside is that I've proposed more talks than ever before. I hope the organisers don't select all of them (I'd like to see <i>some</i> of the conference) but I've given them lots of choice<nobr> <wbr></nobr>:-)</p><p>There are a couple of talks based on the conference's theme of "Corporate Perl".</p><ul>
<li> <b>Why Corporates Hate Perl</b> <br>This will be loosely based on my <a href="http://www.oreillynet.com/onlamp/blog/2008/08/why_corporates_hate_perl.html">blog post</a> from lst year - but I've got lots of other things to add based on the feedback I received. This is, at least partly, a sequel to <a href="http://mag-sol.com/talks/yapc/2006/lang/">Programming Languages and Perl</a> and <a href="http://mag-sol.com/talks/yapc/2008/proud/">Proud to Use Perl</a>.</li><li> <b>Why do so many companies re-invent well-known CPAN modules badly and end up writing far too much code?</b> <br>I was going to give this talk at a recent London.pm technical meeting, but was ill and was unable to present it. The title pretty much describes what I'll cover.</li></ul><p>There's a talk following up on something I spoke about last year in Copenhagen.</p><ul>
<li> <b>Perl in RPM-Land (The Return)</b> <br>Last year I talked about <a href="http://mag-sol.com/talks/yapc/2008/rpm/">building RPMs</a> of CPAN modules and suggested that we could do this automatically for a large percentage of modules. This is conference-driven development. If this talk is chosen then I'll have to make a start on the project.</li></ul><p>And there's a talk about a project that I'm currently pretty enthused about.</p><ul>
<li> <b>The Planetarium</b> <br>This is about using Perl to aggregate web feeds. In particular I'm trying to build sites that are useful tools for building local communities. It's not really on-topic for the conference, but I think it's interesting.</li></ul><p>So now it's just a case of seeing which ones the conference organisers choose. Does anyone know when that will be announced?</p><p> <b>Update:</b> They chose <a href="http://yapceurope2009.org/ye2009/talk/1939">Why do so many companies re-invent well-known CPAN modules badly and end up writing far too much code?</a> and <a href="http://yapceurope2009.org/ye2009/talk/2069">The Planetarium</a>.</p><p>I'll see you in Lisbon.</p>davorg2009-05-01T10:58:39+00:00journalPerl on LLVM
http://use.perl.org/~Matts/journal/38786?from=rss
<p>There was recently <a href="http://www.nntp.perl.org/group/perl.perl5.porters/2009/04/msg145425.html">some talk</a> on p5p about getting perl up and running on the <a href="http://llvm.org/">LLVM</a>. This was following the recent excitement from the Python crowd about the <a href="http://arstechnica.com/open-source/news/2009/03/google-launches-project-to-boost-python-performance-by-5x.ars">Unladen Swallow</a> project, and less so, the <a href="http://www.macruby.org/blog/2009/03/28/experimental-branch.html">MacRuby Experimental Branch</a>.</p><p>So following that post I decided to see how easy/hard it was to get to the first stage - getting perl compiled and running with clang, the llvm gcc-like compiler.</p><p>It wasn't too hard (a lot of <a href="http://xkcd.com/303/">compiling</a>). After I got everything running I first ran perlbench, which looked reasonably promising:</p><blockquote><div><p> <tt> gcc llvm<br> --- ----<br>arith/mixed 100 86<br>arith/trig 100 86<br>array/copy 100 101<br>array/foreach 100 92<br>array/index 100 93<br>array/pop 100 96<br>array/shift 100 95<br>array/sort-num 100 89<br>array/sort 100 101<br>call/0arg 100 102<br>call/1arg 100 89<br>call/2arg 100 75<br>call/9arg 100 89<br>call/empty 100 87<br>call/fib 100 90<br>call/method 100 98<br>call/wantarray 100 89<br>hash/copy 100 95<br>hash/each 100 94<br>hash/foreach-sort 100 97<br>hash/foreach 100 91<br>hash/get 100 91<br>hash/set 100 89<br>loop/for-c 100 86<br>loop/for-range-const 100 111<br>loop/for-range 100 116<br>loop/getline 100 96<br>loop/while-my 100 94<br>loop/while 100 96<br>re/const 100 86<br>re/w 100 89<br>startup/fewmod 100 95<br>startup/lotsofsub 100 93<br>startup/noprog 100 101<br>string/base64 100 89<br>string/htmlparser 100 92<br>string/index-const 100 81<br>string/index-var 100 108<br>string/ipol 100 103<br>string/tr 100 86<br>
<br>AVERAGE 100 93</tt></p></div> </blockquote><p>So next step was to try some more real-world code. I took 41k non-spam mails and ran SpamAssassin on them (using the mass-check tool), with no network tests enabled, and a HTML::Parser also compiled with LLVM (and gcc, in the gcc instance).</p><p>Results of the timings:</p><blockquote><div><p> <tt>GCC:<br>
<br>real 40m56.599s<br>user 64m44.586s<br>sys 0m59.644s<br>
<br>LLVM:<br>
<br>real 45m38.831s<br>user 71m14.218s<br>sys 1m20.882s</tt></p></div> </blockquote><p>So rather less promising.</p><p>Still, an interesting start - see the original link for information on where it needs to go from here. I think this might have a lot of mileage if the actual internals were ported to LLVM style code. If someone is interested in picking up this project, and maybe being paid for it, please get in touch.</p>Matts2009-04-09T17:57:03+00:00journalDBD::SQLite and Unicode
http://use.perl.org/~miyagawa/journal/38770?from=rss
<p>Attention to anyone using DBD::SQLite and $dbh->{unicode} attribute set to 1.</p><p>This module has <a href="http://rt.cpan.org/Public/Bug/Display.html?id=25371">a long standing bug</a> where it assumes passed strings internal encoding is UTF-8 when inserting values into the database and I'm trying to fix it.</p><p><code><br>use DBI;<br>use Encode;</code></p><p><code>my $utf8_string = "This is \x{30c6}\x{30b9}\x{30c8}"; # "Test" in Japanese<br>my $utf8_bytes = encode_utf8($string);<br>my $lat1_string = "H\xe9llo World"; # Héllo</code></p><p><code>my $dbh = DBI->connect("DBI:SQLite:...",<nobr> <wbr></nobr>...);<br>$dbh->{unicode} = 1;</code></p><p><code>my $sth = $dbh->prepare("INSERT INTO foo (bar) VALUES (?)";</code></p><p><code>$sth->execute($utf8_string); # (1) Good<br>$sth->execute($utf8_bytes); # (2) ???<br>$sth->execute($lat1_string); # (3) ???<br></code></p><p>Current version of DBD::SQLite (prior to 1.21) assumes given string's INTERNAL encoding as UTF-8 and stores the octet stream into the database without calling encode_utf8 nor utf8::upgrade, so this makes #2 PASS and #3 FAIL (invalid UTF-8 octet in the database), which is not correct.</p><p>My patch solves this, and #2 $utf8_bytes will be now double encoded and FAIL, but #3 PASS with correct UTF-8 octet stream.</p><p>That #2 FAIL might break your (potentially-already-broken) app, when you try to save UTF-8 encoded strings into the database under 'unicode' option, but I believe this is a right fix to make it FAIL.</p><p><a href="http://svn.ali.as/cpan/trunk/DBD-SQLite/t/rt_25371_asymmetric_unicode.t">http://svn.ali.as/cpan/trunk/DBD-SQLite/t/rt_25371_asymmetric_unicode.t</a> is a failing test by Juerd and <a href="http://fisheye2.atlassian.com/changelog/cpan/trunk/DBD-SQLite?cs=6077">http://fisheye2.atlassian.com/changelog/cpan/trunk/DBD-SQLite?cs=6077</a> is my patch to fix that. This patch still passes all tests, including 12_unicode.t and 20_blobs.t, and this makes DBD::SQLite's unicode option compatible to what DBD::mysql's mysql_enable_utf8 option does, etc.</p><p>Note that if you REALLY want to save the octet bytes without being encoded into UTF-8, you can still define the table with BLOB column type and <a href="http://search.cpan.org/~adamk/DBD-SQLite-1.20/lib/DBD/SQLite.pm#Database_Handle_Attributes">use 3-arg bind_param like explained in DBD::SQLite POD</a>. That 'unicode' section continues to be entirely correct with this patch.</p><p>Let me know your input in #dbd-sqlite on irc.perl.org. Testing your app with my patch and reporting it back would be highly appreciated too.</p>miyagawa2009-04-07T23:51:22+00:00journalTask::Kensho RPMs
http://use.perl.org/~davorg/journal/38730?from=rss
<p>One of the first concrete outputs from the <a href="http://www.enlightenedperl.org/">Enlightened Perl Organisation</a> has been <a href="http://search.cpan.org/dist/Task-Kensho/">Task::Kensho</a> - a CPAN module which exists to list a number of other CPAN modules that modern Perl programmers should consider using. if you install Task::Kensho then all of the included modules will automatically be pulled down from CPAN and installed.</p><p>I don't install my modules from CPAN. As I live in the Red Hat world, I like to install RPMs of modules. And I build RPMs for modules that aren't already available in that format (and then I <a href="http://rpm.mag-sol.com/">make them available to everyone</a>).</p><p>So last night I created an RPM for Task::Kensho. This also involved building RPMs for about half of the modules it include which didn't already exist as RPMs in the standard repostories. Those RPMs are now available from <a href="http://rpm.mag-sol.com/">my repository</a> so installing them all could be as simple as <tt>sudo yum install perl-Task-Kensho</tt>. Of course, you can also install individual packages using the appropriate <tt>yum</tt> command.</p><p>Currently the RPMs are only available for Fedora 10. I'll build versions for Centos 5 over the next couple of days.</p>davorg2009-03-31T08:02:06+00:00journalMySQL Stupidity
http://use.perl.org/~davorg/journal/38549?from=rss
<p>Been a while since I reported on MySQL's stupidity, but I came across a fine new example yesterday.</p><p>Create a table with a varchar column.</p><blockquote><div><p> <tt>create table foo (foo varchar(10));</tt></p></div> </blockquote><p>Insert a data value which is two numbers separated by a pipe character (don't ask, just accept that this was the data format I found in my table).</p><blockquote><div><p> <tt>insert into foo values ('111|1');</tt></p></div> </blockquote><p>Now let's try to select some data.</p><blockquote><div><p> <tt>mysql> select * from foo where foo = '111|1';<br>+-------+<br>| foo |<br>+-------+<br>| 111|1 |<br>+-------+<br>1 row in set (0.00 sec)</tt></p></div> </blockquote><p>Ok. That makes sense. That's expected behaviour.</p><blockquote><div><p> <tt>mysql> select * from foo where foo = '111';<br>Empty set (0.00 sec)</tt></p></div> </blockquote><p>That also makes sense, of course. The string isn't '111', so it doesn't match.</p><blockquote><div><p> <tt>mysql> select * from foo where foo = 111;<br>+-------+<br>| foo |<br>+-------+<br>| 111|1 |<br>+-------+<br>1 row in set (0.00 sec)</tt></p></div> </blockquote><p>Huh! I mean "What!?!".</p><p>There are at least two fundamentally stupid things going on here.</p><p>Firstly, MySQL is allowing me to match a string column against a number. When a user tries to match a value of one type against a column of another type, the only sensible action is to throw an error. The user is trying to do something completely wrong. Tell them that. Don't try and work something out.</p><p>Secondly, if you insist on trying to convert datatypes in order to force a match, then convert the user's data into the database column's datatype, not the other way round. The database column is a string. Convert the number to a string and try to match that string against the database (that would have returned no data). Instead MySQL is trying to convert the database value into a number to match the user's input. It looks like it's using something like Perl's string to number conversion so the string "111|1" is converted to the number 111 and therefore matches the user's input.</p><p>So you can actually get MySQL to match data which doesn't match at all. I wasted two hours on this yesterday.</p><p>I found this yesterday on a MySQL 4.x server. I've just tried it on a 5.0.67 server and the same bug is still there.</p><p>Oh, and setting the SQL mode to "traditional" doesn't seem to fix it either.</p>davorg2009-02-25T21:56:38+00:00journalYak Shaving
http://use.perl.org/~davorg/journal/38505?from=rss
<p>For a few months I've been playing with <a href="http://conky.sourceforge.net/">conky</a> - which is a nice system for writing stuff onto a Linux desktop. I was introduced to it by a series of <a href="http://lifehacker.com/search/conky/">LifeHacker posts</a> last year.</p><p>Just last week, they featured <a href="http://lifehacker.com/5152819/to+dos-weather-and-twitter-on-a-linux-desktop">a really nice set-up</a> which I wanted to go some way to recreated. The post included a link to the programs that were used to create the desktop, so it was easy to work out what was going on.</p><p>Most of the data was pulled from web feeds and converted to flat text. That's a nice approach as once you've got that working, there's no limit to the data you can use.</p><p>I was slightly disappointed, however, to see that the code included in the article had three separate scripts (one for each source used) and that they were all bash scripts which used curl to grab the feeds and load of sed and grep to extract the relevant parts. What this really needed was a generic approach.</p><p>So I reached for the <a href="http://search.cpan.org/dist/Template-Toolkit/">Template Toolkit</a>. And I reached for <a href="http://search.cpan.org/dist/Template-XML/">Template::Plugin::XML::RSS</a>. And then I stopped myself. Not all web feeds are RSS these days (that's why we've largely stopped calling them RSS feeds) so <a href="http://search.cpan.org/dist/XML-RSS/">XML::RSS</a> wouldn't always be the right tool. What I really needed was <a href="http://search.cpan.org/dist/XML-Feed/">XML::Feed</a> - which handles both RSS and Atom and treats them both in the same way.</p><p>But there wasn't a Template::Plugin::XML::Feed. I say "wasn't" rather than "isn't" as <a href="http://search.cpan.org/dist/Template-Plugin-XML-Feed">there is one now</a> - I uploaded it last night.</p><p>I didn't get much time to play with conky. But I've now got all of the tools I need. In particular, I can create simple programs like this to access web feeds.</p><blockquote><div><p> <tt>#!/usr/bin/perl<br> <br>use strict;<br>use warnings;<br> <br>use Template;<br>use URI;<br> <br>my $t = Template->new;<br>my $uri = URI->new('http://search.twitter.com/search.atom?q=@davorg');<br>$t->process(\*DAT<nobr>A<wbr></nobr> , { uri => $uri })<br> or die $t->error;<br> <br>__END__<br>[% USE tweets = XML.Feed(uri);<br> USE autoformat(right => 80);<br> FOREACH tweet IN tweets.entries -%]<br>[% tweet.author %]:<br>[% tweet.title | autoformat -%]<br>[% LAST IF loop.count == 5 -%]<br>[% END -%]</tt></p></div> </blockquote><p>Of course, I need to remove the hard-coded URI and put the template into a separate file. That's tonight's first little project.</p>davorg2009-02-18T13:23:06+00:00journalprint scalar gmtime 1234567890
http://use.perl.org/~grinder/journal/38468?from=rss
<p>It seems like only yesterday we passed epoch 1000000000 when in fact it was nearly eight and a half years ago. On the other hand I remember epoch 1111111111 quite clearly since it was just before my birthday.</p><p>And now we come to another momentous epoch, that of 1234567890. I just happened to notice this as I was watching a Cyrus imapd logfile.</p><p>2009-02-13 23:31:30 UTC, by my reckoning. A good excuse for a pint, if you ask me.</p>grinder2009-02-12T21:15:54+00:00journalData::Dumper + Perltidy
http://use.perl.org/~jmcnamara/journal/38367?from=rss
I use Data::Dumper a lot when debugging applications that return complex data structures. However I'm not always happy with the pretty printing that Data::Dumper provides and I often find myself copying he structure into Emacs and running perltidy against it.
<p>
As such I thought that it would be nice to have a Data::Dumper::Perltidy module that would do both steps in one go. I didn't find such a module on CPAN so I wrote <a href="http://search.cpan.org/~jmcnamara/Data-Dumper-Perltidy/lib/Data/Dumper/Perltidy.pm">one</a>.
</p><p>
John.<br>
--</p>jmcnamara2009-01-30T10:37:22+00:00journalPerl and the Art of Motorcycle Navigation
http://use.perl.org/~jmcnamara/journal/38320?from=rss
<p>
A lot of people use <a href="http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm">Spreadsheet::WriteExcel</a> I think. At least I get a lot of emails related to it. At the same time I don't generally get an insight into what people use the module for. There are some obvious tasks that I can imagine such as invoices or inventories or balance sheets and the email addresses of the correspondents suggest a heavy usage among financial companies. The occasional example Excel file that I receive isn't usually very exciting, not least of all when viewed in a hex editor. As such Spreadsheet::WriteExcel is used for the mundane reporting we all have to do occasionally. (Apart from me that is. In the eight years with my current company I've only used Spreadsheet::WriteExcel once and that was in the last six months. So much for eating your own dogfood).
</p><p>
That's why I was blown away when Rick Lavigne contacted me to say he was using Spreadsheet::WriteExcel to produce Tulip Diagram roll charts for motorcycle navigation. If you don't know what that is, and I certainly didn't, have a look at Rick's website <a href="http://www.rollcharts.org/">rollcharts.org</a> where it is all explained in detail. In particular the quality of the <a href="http://www.rollcharts.org/roll_chart_turn_inst.xls">finished worksheets</a> really impressed me.
</p><p>
In fact it impressed me so much that I felt obliged to help Rick out. He had written to ask if a document properties feature was planned. It was on the TODO list but with a low priority so I moved it up the list and <a href="http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#set_properties()">implemented it</a>. There probably aren't many advantages to running your own Open Source project but at least you can set your own priorities.
</p><p>
John.<br>
--</p>jmcnamara2009-01-21T00:25:02+00:00journalDakar
http://use.perl.org/~Matts/journal/38317?from=rss
<p>Just want to publicly say congratulations to my brother-in-law Quin for coming <a href="http://www.automobilsport.com/dakar-2009-rally-quin-evans-yorkshire-driver-tollefsen-fourth-overall---39722.html">fourth overall</a> in this year's grueling Dakar rally. An amazing achievement for a non-factory team.</p>Matts2009-01-19T15:10:00+00:00journalCPAN Timeline
http://use.perl.org/~miyagawa/journal/38296?from=rss
Have a Google account and Perl hacker friends? Try <a href="http://cpan-timeline.bulknews.net/">CPAN Timeline</a> and see what your friends are hacking on. This could be a proof-of-concept app how to make CPAN more social place. The other approach using the existent social network includes <a href="http://www.facebook.com/apps/application.php?id=5786910451">Leon's facebook CPAN app</a>.miyagawa2009-01-15T17:57:25+00:00journalReleasing Press Releases to the Press
http://use.perl.org/~davorg/journal/38149?from=rss
<p> <a href="http://www.prweb.com/releases/2008/12/prweb1783874.htm">The Perl Foundation Migrates the Perl 5 Development Repository to the Git Version Control System</a> </p><p>That's not news, of course. You all read that <a href="http://use.perl.org/article.pl?sid=08/12/22/0830205">story on the front page of use.perl</a> a couple of days ago.</p><p>What's new (I think) is where you can find the press release. It's on <a href="http://www.prweb.com/">PRWeb</a>. For those who don't know, PRWeb is the best-known press release distribution service. The TPF Git press release will now be arriving in the inbox of hundreds of editors and other interested parties who have subscribed to technology news. And that, of course, increases the chance that the story will be published in the tech press and that people outside of the echo chamber will read it.</p><p>When the Git news broke a couple of days ago, we were discussing it the london.pm IRC channel. <a href="http://use.perl.org/~acme">acme</a> had published the press release in the usual Perl news channels, but someone suggested that as we had a press release, it would be nice to get it out through the standard press release channels.</p><p>It turned out that <a href="http://davehodg.blogspot.com/2008/12/perl-foundation-migrates-perl-5.html">Dave Hodgkinson</a> had a) a PRWeb login, b) half an hour to spare to register the press release and c) the $80 it costs to use the service.</p><p>I have no idea how successful this will be, but it seems to me that if the Perl community has interesting news like this, then it's worth spending the occasional $80 to get that news out on the wires.</p><p>It's got to be worth a try. Thanks to Dave for his efforts.</p><p> <b>Update:</b> <a href="http://blogs.zdnet.com/community/?p=147">Over on ZDNet</a>, Joe Brockmeier adds his thoughts to the discussion.</p>davorg2008-12-24T09:57:02+00:00journalPerl Training in London
http://use.perl.org/~davorg/journal/38111?from=rss
<p>In conjunction with the UKUUG and O'Reilly, I'm running two days of Perl training in London in February.</p><p>The first day (the 25th) is a beginners' course and the second day (the 26th) is a lot more advanced.</p><p>Full details (including a sign-up form) are <a href="http://www.ukuug.org/events/perl09/">on the UKUUG web site</a>.</p><p>Hope to see some of you there.</p>davorg2008-12-17T16:40:41+00:00journalShibuya.pm Tech Meeting #10
http://use.perl.org/~miyagawa/journal/37942?from=rss
<p>Shibuya Perl Mongers tech meeting #10 is full of <a href="http://shibuya.pm.org/blosxom/techtalks/2008011.html">interesting talks</a> and is scheduled on <a href="http://permatime.com/Asia/Tokyo/2008-11-27/18:30">November 27th, Thursday 18:30 in Japan time</a>. There will be <a href="http://www.ustream.tv/channel/shibuya-perl-mongers">ustream.tv</a> streaming available for all talks.</p><p>I will give a short talk and demo about my new toy <a href="http://code.google.com/p/remedie">remedie</a>. This is my answer to the recent video sharing and tv shows buzz over the internet, using my other powerful tool Plagger. I already can't live without this app and I hope I'll talk about it in YAPCs (Asia, NA, EU) and OSCON.</p>miyagawa2008-11-25T19:45:57+00:00journalPerl Unsafe Signals
http://use.perl.org/~Matts/journal/37798?from=rss
<p>This is just to document (and place in google) how to do unsafe signals in recent perls without loading a non-core library to do it:</p><blockquote><div><p> <tt> use POSIX qw(SIGALRM);<br> my $timeout = 30;<br> my $sigset = POSIX::SigSet->new(SIGALRM);<br> my $action = POSIX::SigAction->new(<br> sub {<br> # re-install alarm in case we were in an internal eval{} block<br> alarm($timeout);<br> die "timeout working on: " . (caller(1))[1] . "\n";<br> },<br> $sigset,<br> &POSIX::SA_NODEFER, # turns off safe signals<br> );<br> POSIX::sigaction(SIGALRM, $action);<br> my $prev_alarm = alarm($timeout);<br>
<br> eval {<br> # long running code here<br> };<br> my $err = $@;<br> alarm($prev_alarm);<br> if ($err) {<br> if ($err !~<nobr> <wbr></nobr>/timeout working on:/) {<br> die $err; # propogate this error<br> }<br> # process the timeout<br> }</tt></p></div> </blockquote><p>This is written for alarms, which TBH is probably where you really need it, since the regexp engine can get its knickers in a twist and not fire your alarm until the heat death of the universe, but the code will work for other types of signals too.</p><p>And yes, I know there are modules on CPAN for this, such as the excellent and very simple Perl::Unsafe::Signals, but sometimes another module isn't an option. I also know the code is a bit flawed in that the second installation of the alarm doesn't do the right thing (it should install at as $timeout - (time - $start_time)), so feel free to fix it yourself.</p>Matts2008-11-03T20:39:10+00:00journalRoadmap for Spreadsheet::ParseExcel
http://use.perl.org/~jmcnamara/journal/37770?from=rss
<p>
I've added a <a href="http://groups.google.com/group/spreadsheet-parseexcel/browse_thread/thread/81ad9c69a35729d1">Roadmap for Spreadsheet::ParseExcel</a> on the Spreadsheet::ParseExcel Google Group.
</p><p>
John.<br>
--</p>jmcnamara2008-10-31T07:00:23+00:00journalperlhacks.com
http://use.perl.org/~davorg/journal/37764?from=rss
<p>A few years ago I tried to register the domain perlhacks.com. It wasn't available at the time so I registered the domain perlhacks.org instead. As so often happens, I didn't have time for the project I planned to use it for so it did nothing useful until I made it a redirection to the O'Reilly catalogue page for <a href="http://oreilly.com/catalog/9780596526740/">Perl Hacks</a>. At that point I largely forgot about the domain.</p><p>A couple of weeks ago I got an email from someone telling me that perlhacks.com was for sale. This was a domain reseller and they were targeting me because I already owned the<nobr> <wbr></nobr>.org. They were asking for $997 (but the web page also said 'make us an offer'). They must have been pretty desperate as over the next week or so I got three or four more emails from the same people. They never dropped their price though.</p><p>Today I got another mail from them. And this time when I visited the site the price had dropped to $99. I mentioned this in passing on the #london.pm IRC channel and someone else pointed out that actually the domain had lapsed and was available for anyone to buy. In which case, $99 was far more than you'd expect to pay.</p><p>I checked with my usual domain register and found that the domain was, indeed, available. So I ordered it. Actually three of us ordered it at about the same time and my registry obviously had the fastest systems in place as I got the registration. For less than £10. I then took great pleasure in replying to the people who were trying to sell me the domain telling them what I'd done. I didn't get a reply.</p><p>But now I have both perlhacks.org <i>and</i> perlhacks.com. And I still don't really have a plan for what I'm going to do with them.</p><p>Does anyone have any ideas?</p>davorg2008-10-29T17:41:50+00:00journalPlease test File::Path 2.06_06
http://use.perl.org/~grinder/journal/37757?from=rss
<p>A couple of usability bugs turned up when File::Path was dragged kicking and screaming into the third millennium, with its new options hash interface.</p><p>Refactoring the code introduced a nasty symlink chmod 777 error, and the heuristics for detecting the new way of calling <tt>rmtree</tt> and <tt>mkpath</tt> made the wrong call in some circumstances.</p><p>All should be fixed, and the code as it stands should be ready to be bundled with perl 5.8.9. To help this happen, could people <a href="http://search.cpan.org/dist/File-Path/">give this a spin</a>?</p><p>Notably, users of minicpan should see errors about uninitialized variables go away, and people who see spurious all-digits directories created in $HOME should also see them go away.</p><p>Also, is the documentation clear? Please lodge RT reports for any problems you encounter.</p>grinder2008-10-28T10:31:43+00:00journalTaking over maintenance of Spreadsheet::ParseExcel
http://use.perl.org/~jmcnamara/journal/37751?from=rss
<p>I've taken over the maintenance of Spreadsheet::ParseExcel from Gábor Szabó.</p><p>I didn't want to because I barely get enough time to maintain/extend Spreadsheet::WriteExcel. However, Gábor is very busy with other projects and ParseExcel needs to be kept ticking over since it is so widely used and ultimately I'm probably the best person to deal with the Excel internals that are at the heart of the module.</p><p>Initially I plan to clean up the documentation, add more working examples and deal with the more egregious bugs. I may try to clean up and document the internals as well so that someone else can take over maintenance and so that patches are more consistent. It will also give me a chance to get ParseExcel and WriteExcel working better together.</p><p>Anyway, I've set up a Google Group for discussions relating to the module:</p><p>
http://groups.google.com/group/spreadsheet-parseexcel</p><p>Feel free to join, post, chat if you are interested.</p><p>John.<br>--</p>jmcnamara2008-10-27T19:20:02+00:00journalPerl Blogs
http://use.perl.org/~davorg/journal/37674?from=rss
<p>At YAPC::Europe this year I gave a talk called <a href="http://www.slideshare.net/davorg/proud-to-use-perl-presentation">Proud to Use Perl</a> where I talked about some of the achievements of the Perl community and suggested that we should shout about these achievements a little more than we do.</p><p>And as an example of this shouting, I set up a new <a href="http://proudtouseperl.org/">Proud to Use Perl</a> web site where I was going to write about all of the amazing things that Perl has to be proud of.</p><p>Which I did for about a week.</p><p>It's always the same. I go to a Perl conference, get too enthused about stuff and end up volunteering to get involved in too many projects and having to spread myself too thin.</p><p>So the Proud to Use Perl site effectively died.</p><p>But even though I don't have the time to put into it, I still think it's a good idea. And I wondered if anyone else would be interested in getting involved.</p><p>So I'm looking for a few people who would like to write for the site. It would be great if we could get new an interesting things published on the site every couple of days. Surely there's no shortage of things for the Perl community to be proud of. It might be a good place, for example, to share success stories.</p><p>Anyone interested in getting involved? Leave a comment here or drop me an email.</p><p>And that's not the only Perl web site project I've been neglecting. Earlier this year, I registered the domain <a href="http://culturedperl.org/">culturedperl.org</a>. The idea with that was that I'd set up a blog talking about Perl culture (in some vague, undefined way). But that site was abandoned even sooner. I didn't even get as far as installing Movable Type.</p><p>So I'm interested in getting a few authors to help me out there too. Maybe a few Perl Monger group leaders could write things there? Or people involved in organising YAPCs. Or people involved in other parts of the culture - Perl Monks, perhaps, or Perl Golf.</p><p>I'll get MT installed on the server this evening. Same thing applies, if you're interested then leave a comment or drop me an email.</p><p>More Perl blogs has got to be good, right?</p>davorg2008-10-16T08:58:05+00:00journalPerl on Upcoming
http://use.perl.org/~davorg/journal/37627?from=rss
<p>I've banged on before about how Perl is seen as less popular than it really is because the Perl community can be a bit insular. I believe that we need to get out there and tell people that a) we're still here and b) we're still wonderful.</p><p>As an example of that, we've started to ensure that all of London.pm's events are listed on <a href="http://upcoming.yahoo.com/">Upcoming</a> and we encourage people to register their attendance so that we can demonstrate how popular our meetings are. Recently, I also created a <a href="http://upcoming.yahoo.com/group/12343/">London.pm group</a> to make it easier to track down our events. When adding events to our group, I also add them to a couple of other local geeky groups - which gives us a bit of free publicity. Maybe other local groups could consider doing the same (I see that <a href="http://upcoming.yahoo.com/group/?scope=all&q=perl&Search=Search+Groups">some already do</a>).</p><p>Today I also created a global <a href="http://upcoming.yahoo.com/group/12635">Perl group</a> with the intention of collecting all worldwide Perl events. If you create any kind of Perl-related event on Upcoming then please add it to the group.</p>davorg2008-10-09T08:52:47+00:00journal