ivorw's Journal http://use.perl.org/~ivorw/journal/ ivorw'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:23:00+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 ivorw's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~ivorw/journal/ Firefox/Iceweasel Java plugin on Debian http://use.perl.org/~ivorw/journal/32652?from=rss <p>I thought I'd share this here, as it's something to trip up the unwary. Posted here because there are many Debian/ Knoppix/ Ubuntu users in the Perl community.</p><p>I've had need to use a web based chat client for accessing a vendor's support facility, which needs the Java plugin. Fine, I go to the relevant page, which appears complete with jigsaw icons and the "Install Missing Plugins" button.</p><p>Sadly, it's one of those plugins that doesn't install at the click of a button, so I'll list the details of what needs to be done to install it.</p><p>First, there's a <a href="http://java.com/en/download/linux_manual.jsp">download page</a>. Choose the second option: "Linux (self-extracting file)". Keep track of where you have saved this, e.g. non-root user's home directory or desktop. </p><p>Now, there are several ways of proceeding, but I present one method which gives an upgrade path. For this, you need to have the Debian packages fakeroot and java-package, together with any dependencies installed.</p><p>Issue the following commands</p><blockquote><div><p> <tt>fakeroot make-jpkg [jre file you downloaded]</tt></p></div> </blockquote><p>This will prompt you with a "proceed" question, and also present you with the full text of the license, which you need to scroll through and agree to. This results in a debian package, which you then install with:</p><blockquote><div><p> <tt>sudo dpkg -i [package]</tt></p></div> </blockquote><p>Run the command java -version to check that the installation has worked. Now you need to symlink in the plugin, so that Firefox can see it. Plugins are kept in a directory off ~/.mozilla called plugins, which might not exist; create it if it doesn't exist, then place a symlink to the plugin in this directory</p><blockquote><div><p> <tt>ln -s<nobr> <wbr></nobr>/usr/lib/j2re1.5-sun/plugin/i386/ns7/libjavaplugin_oji.so<nobr> <wbr></nobr>.</tt></p></div> </blockquote><p>Now, you need to restart Firefox, and you should pick up the plugin.</p> ivorw 2007-03-12T00:36:26+00:00 journal I'm no longer in wind down mode http://use.perl.org/~ivorw/journal/32462?from=rss <p>Well, LCH have decided to extend my assignment until June. I also know that they've been having difficulties hiring a permie for my role, which is not surprising given that most people with the technical skills and background would prefer to work in a development role.</p><p>Beyond June, my suggestion of offering part time consultancy is being taken seriously. This would be very cool.</p><p>I'm feeling much more motivated at LCH, and I feel I am being listened to and taken seriously.</p> ivorw 2007-02-21T14:14:05+00:00 journal I'm in wind down mode at LCH http://use.perl.org/~ivorw/journal/31976?from=rss <p>I've been informed that my present assignment at the London Clearing House will end at the beginning of March. This is cool, because I won't be out of a job as a result. This is the beauty of working for a consultancy: you get paid when you're not out on site at a client's, when you're "on the bench". I will have been at LCH for 4 years, come February, and my employers are quite pleased with me, having such a long assignment.</p><p>LCH are going to be hiring a permie as a replacement. I've also been tasked with coming up with a job spec. If you're interested, see my <a href="http://mail.pm.org/pipermail/banking-pm/2006-December/000073.html">posting to the banking.pm list</a>, use the contact details given. There's not much Perl involved in this job; the Perl may wither once I have gone.</p><p>Depending on what my employers want me to do next, I may be spending more time in the Perl Community. Also, in the mean time, I'm not particularly motivated to do much for LCH.</p> ivorw 2006-12-20T10:58:20+00:00 journal Multiple perls on one box, some tips and tricks http://use.perl.org/~ivorw/journal/31402?from=rss <p> <strong>Why you might want to do this</strong> </p><p>Maybe, the perl on the host you are running on, is one you have no control of. It could be that the hosting company or your employer, doesn't allow you root access. Maybe you want a more up to date perl than that provided.</p><p>Another reason is to have a "virgin perl" to use with the CPAN testers' YACSmoke programme. There are advantages to using the minimum installation: you'll pick up module dependencies that many smoke testers would miss. This would be completely separate from your "working perl", which has all the modules you need to do your work, and for the sysadmins, and the package installers.</p><p>In my case, it's the latter reason. I'm using Debian (Sid actually, and so the perl and packaged modules are pretty up to date), and am setting up two "virgin perls", one with 5.8.8 and one with bleadperl. I've created user accounts specially for the purpose.</p><p>I've not tried this on Windows. Maybe it's possible to have a vanilla perl installed elsewhere to <code>C:\Program files</code>, outside the path for normal operations.</p><p> <strong>Planning and execution</strong> </p><p>Decide on where you want to put your perl. In my case, this has involved creating new user accounts. In my case, the perl will live under<nobr> <wbr></nobr><code>/home/perl-base</code>.</p><p>Obtain the tarball for the perl you want. Untar this into a build directory. In my case,<nobr> <wbr></nobr><code>/home/perl-base/perl-5.8.8</code> is fine: I untar as user perl-base in the user's home directory. cd into the top level directory.</p><p>We're going to vary from the normal mantra given in the INSTALL document. Run the command<nobr> <wbr></nobr><code>./Configure -de</code> to generate the files config.sh and Policy.sh. If this encounters any problems, BAIL OUT! These would indicate an issue on your O/S platform; most of these have been ironed out over time, but this still could be something worth reporting to p5p via perlbug, especially if you are messing with bleadperl.</p><p>We're going to throw away the config.sh, but keep the Policy.sh. Remove config.sh, but edit Policy.sh. Globally replace<nobr> <wbr></nobr><code>/usr/local</code> with your destination install base directory, in my case<nobr> <wbr></nobr><code>/home/perl-base</code>. Uncomment the shell variable lines that you have changed.</p><p>Now, run<nobr> <wbr></nobr><code>./Configure</code> again. In my case I use <code>-de</code> again as I'm building a perl with default configuration - your mileage may vary.</p><p>Run <code>make</code>, <code>make test</code> and <code>make install</code>. You don't need to run the <code>make install</code> as root.</p><p>You may need to edit<nobr> <wbr></nobr>.bash_profile to add the new bin directory to your path. In my case, the boilerplate<nobr> <wbr></nobr>.bash_profile contained code to add the user's bin directory to the path if it exists, so I just needed to source in<nobr> <wbr></nobr>.bash_profile. You might be using a different shell to bash - ymmv.</p><p> <code>perl -V</code> and voil&agrave;</p> ivorw 2006-10-24T07:41:31+00:00 journal Bookmooch http://use.perl.org/~ivorw/journal/31069?from=rss <p>I've recently subscribed to <a href="http://www.bookmooch.com/">http://www.bookmooch.com/</a>, and have been finding a growing community of people with an interest in books.</p><p>I've also become involved in the community through the forum mailing list attached to the site. Seeing the high volume on the list prompted me to set up an IRC channel, #bookmooch on irc.freenode.org. I'm running my cronic time bot here, and I am thinking about other bots or plugins, such as ISBN lookup.</p> ivorw 2006-09-21T07:51:44+00:00 journal (BT fault finding)++ http://use.perl.org/~ivorw/journal/30608?from=rss <p>Yesterday, I had a nice experience getting a problem with my land line sorted out. Many people have slagged off British Telecom for being inefficient or incompetent, but I feel tha on this occasion they have given me good service.</p><p>The problem was the the line had become very noisy, with crackles making dialling let alone conversation impossible. The ADSL was also dropping out intermittently - I could tell that this had started happening from around 16:00 from my IRC scrollback.</p><p>As I was still having some broadband connectivity, I decided to try logging the fault through http://www.bt.com/faults. Not only was there a sensible input form with a dropdown select with a list of reasons, but after I logged the call, I got the opportunity to turn on two features:</p><ul> <li> <p>Redirect incoming calls to my mobile for the duration of the fault</p></li><li> <p>Progress of call sent as text messages to the mobile.</p></li></ul><p>I had a text come through explaining that they had run tests and identified the problem. The following day, while at work, I had a further text saying they were looking at it - I let my team leader know that I might need to dash off home to give the BT engineer access to my flat. At 12:00, I had another text letting me know that the problem had been fixed.</p><p>So, full marks to BT for their fault service.</p> ivorw 2006-08-12T11:35:35+00:00 journal Tidying up Parse::RecDescent autotrees with topiary http://use.perl.org/~ivorw/journal/29943?from=rss <p>The work on cronic has made me think about using Parse::RecDescent autotrees in modules, as I want to turn the guts of cronic into one or more bot plugins.</p><p>The issue is that autotrees have their nodes blessed into packages corresponding to the rule names. To my mind, this sucks for two reasons. Firstly, you're polluting a namespace with no control, and secondly the objects should be brought into existence through a constructor, not blessing.</p><p>I toyed with rolling my own trees with an autorule, but this didn't give me what I wanted. I posted a wishlist item to RT, but I don't know when that will get looked at, as I know Damian is a busy man.</p><p>I looked briefly at the code in Parse::RecDescent to see if it is patchable, then came up with a better idea. This better idea is to post-process the output from the parser, walking the tree, building properly constructed nodes in a sensible namespace.</p><p>Voila:</p><p> <a href="http://search.cpan.org/~ivorw/Parse-RecDescent-Topiary/"> Parse::RecDescent::Topiary</a> </p> ivorw 2006-06-18T16:28:50+00:00 journal cronic: an IRC bot to do time related things http://use.perl.org/~ivorw/journal/29880?from=rss <p>Inspired by a future need for the <a href="http://cogers.org/">Cogers Society</a> to do online debating, I decided to have a go at writing an IRC bot. This was my first attempt.</p><p>I decided on Bot::BasicBot as a start point - I had heard good things about this module. I picked Time::Piece and Parse::RecDescent as two modules to use that I am already familiar with. </p><p>I found when developing this that lanching the bot gave two warnings about calls to <code>new()</code> being deprecated in POE::Component::IRC. I happened to be in correspondence with the module's author later, and prodded jerakeen (author of Bot::BasicBot) via RT. The outcome is that Bot::BasicBot has now been brought up to date and everyone's happy.</p><p>The idea is to give cronic fairly simple commands, such as:</p><p> <code> cronic: at 12:30 say It's lunch time<br> cronic: after 5:00 say Your five minutes are up<br> <br> </code> </p><p>The bot will ignore any text on the channel for which it has not been directly addressed. The bot will also respond to PRIVMSG, allowing personal reminders.</p><p>There's still plenty of things for me to do:</p><ul> <li> <p>Implement time zones; migrate to DateTime. Work in progress. This has involved me grokking DateTime and associated modules.</p></li><li> <p>Documentation. I need to put up a webpage somewhere with "how to use this bot".</p></li><li> <p>Persistent events in a database. These could include perl monger meeting reminders and people's birthdays.</p></li><li> <p>More commands than just "say". It would be useful for cronic to switch the topic, for example.</p></li></ul><p>The bot is up and running on #bots for those who want to have a play. I'll try and catch any scrollback, but if you want, you can email bug reports to cronic at xemaps.com.</p> ivorw 2006-06-12T14:05:03+00:00 journal London 2.0 RC1 http://use.perl.org/~ivorw/journal/27955?from=rss <p>Yesterday evening, I attended an evening social event. This was a follow up to the web frameworks talks in November, with presentations on Catalyst, Django (python) and Ruby on Rails.</p><p>I was due to be at this venue in any case, as it was the AGM of the <a href="http://cogers.org/">Cogers</a>. I had a smile seeing the sign on the staircase to the minstrel gallery, saying that this area was reserved for London 2.0 RC1, and was reminded of some newbie asking where you could download London.pm from and what it does<nobr> <wbr></nobr>:).</p><p>There were plenty of Python and Ruby geeks present, but only one Perl guy besides myself. A poor show, because I know that this event was posted and discussed on the London.pm list.</p><p>For once, I didn't find myself having to defend or make excuses for Perl. A Python guy asked me about Perl 6, expecting me to be embarrassed; I told him all about Pugs ant the effect it has had on the Perl community, which was news to him. I was also able to update him on Parrot, which he was under the impression was moribund. However, it's probably just pining for the fjords<nobr> <wbr></nobr>:).</p><p>Even if there hadn't been a Cogers meeting in the same venue, I may well have turned up. I will certainly go to the next one if another such meeting is organised. Come on Perl community. Come on London.pm. Where were you?</p> ivorw 2005-12-13T10:43:42+00:00 journal Mirroring OpenGuides websites http://use.perl.org/~ivorw/journal/27209?from=rss <p>In the aftermath of the <a href="http://london.openguides.org/index.cgi?September_2005_Incident">September 2005 incident</a>, I have been thinking about steps we can take to prevent a reoccurrence, or at least minimise the impact.</p><p>As it is, I have lost quite a number of writeups and updates I have made in the last six months.</p><p>I have been looking at decentralising the OpenGuides data by using one or more mirror sites, which hold all the data and are kept up to date. I'm using CPAN mirroring as my model.</p><p>In terms of how to do this, each page has wiki content and metadata. The wiki text can be retrieved using format=raw, for example:</p><p> <a href="http://london.openguides.org/?id=Borough+Market;format=raw">http://london.openguides.org/?id=Borough+Market;format=raw</a> </p><p>This was recently implemented by hex (cheers mate!) - though you could previously achieve the same result by using action=edit and scraping the HTML response for the CGI form corresponding to the text.</p><p>The metadata is obtained in RDF/XML format using format=rdf. This has highlighted a number of issues, resulting in several RT bug tickets for OpenGuides. It has also resulted in a CPAN module OpenGuides::RDF::Reader - standardising data retrieval from OG, mapping namespace qualified tag names into more directly meaningful hash keys. In principle, these translated hash keys match the values going into the column metadata_type in the metadata table.</p><p>The idea is that a guide mirror can pull down new and changed pages, when detected from the RecentChanges RSS feed.</p><p>The guide mirror gives us new possibilities, such as having all OG data on one website. This will allow an aggregated search over all the Guides.</p><p>The other aspect of this is that the data pulled from another site comes with a hash key "source", containing the URL where the data has come from. This will allow implementation of Creative Commons "Attribution", and will allow a future release of OpenGuides to redirect all requests to edit, to the source website.</p><p>Exciting stuff! More to come...</p> ivorw 2005-10-17T10:18:20+00:00 journal Overriding Perl 5 built in functions http://use.perl.org/~ivorw/journal/26416?from=rss <p>I've been working on Devel::Leak::Object, including the <a href="http://rt.cpan.org/NoAuth/Bug.html?id=12942">stringification patch</a> which is very useful<nobr> <wbr></nobr>:) (RT rocks, as does mca).</p><p>I had a problem in that I wanted to defer tracking of the bless function until initialisation is complete. I've since discovered that this is not possible - see <a href="http://perlmonks.org/?node_id=485061">my post to Perlmonks</a>.</p><p>I have gained an understanding of what happens with overrides of built in functions. The crucial point is that these overrides happen at <strong>compile time</strong>. This means that if you have already used (or required) a module before putting the override in place, it is too late for the override to take effect.</p><p>This means that the override also has to be physically first in the script file before the use statements that you want to override, thus:</p><p> <code> #!/usr/bin/perl<br> <br> use strict;<br> use warnings;<br> <br> use Foo; # override not in place<br> use Devel::Leak::Object qw(GLOBAL_bless);<br> use Bar; # with bless overriden<br> <br> </code> </p><p>I also looked at what <code>use subs qw(foo);</code> achieves. What this does is merely a dummy export into its caller's namespace. Once done, a typeglob named foo will exist in the stash, hence will be picked up when parsing barewords. This also affects calls to built ins, which will use the local sub instead. Instead of "use subs", what I needed to do was to export my &amp;bless into other namespaces, as that is what I want to get called.</p><p>There is actually no need to do this in my case, as CORE::GLOBAL magic achieves the same results - unless I want to be picky about exactly in which classes I want bless to be overriden.</p><p>I might well release this functionality (to allow people to be picky) into Devel::Leak::Object 0.03.</p> ivorw 2005-08-22T17:02:10+00:00 journal Business as usual http://use.perl.org/~ivorw/journal/25650?from=rss <p>Today I return to my client's office - the <a href="http://www.lchclearnet.com/">London Clearing House</a>, for the first time since the <a href="http://news.bbc.co.uk/1/hi/in_depth/uk/2005/london_explosions/default.stm">London bombings</a>. The office is next door to Aldgate Underground Station - where one of the bombs went off. Apparently the building shook when it went off.</p><p>Thursday morning, I was travelling into work normally, scheduled to get in at around 09:30. I arrived at Whitechapel, 300 yds northeast of the office via a circuitous route, to find my colleagues assembled - this was our muster point. The office had been evacuated, and was inside a police cordon.</p><p>At 10:30, we were advised what to do. Key individuals, whose presence is needed were advised to make their way to the business continuity suite on the South Bank. Others were advised to go home. Those who were technical with the capability of dialling in were asked to work from home. I arrived home at around 14:00 as there was little or no transport crossing east to west.</p><p>Today, I come in to the office to read several emails stating that LCH's member banks and the regulatory authorities were impressed by our disaster recovery operation. We were up and running from the business continuity suite within an hour, and the members didn't bat an eyelid. It was also a busy time with the markets, with runs on equities and bonds triggered by the bombings.</p><p>I second this, as the attitude of colleagues mustered at the assembly point, and those at the BCS, was one of calm. We have had many business continuity drills and disaster recovery failover exercises in the 2 1/2 years I have been working at LCH. In the event, nobody was panicking, everybody was professional and we all knew what to do. It was, in effect, business as usual.</p> ivorw 2005-07-12T09:37:18+00:00 journal Toronto pictures http://use.perl.org/~ivorw/journal/25462?from=rss <a href="http://myweb.tiscali.co.uk/ivorw/Toronto/">Toronto pictures</a> ivorw 2005-07-01T11:34:00+00:00 journal Toronto - first impressions http://use.perl.org/~ivorw/journal/25371?from=rss <p>Flew in yesterday from LHR (London Heathrow). The first thing to notice is the temperature: &gt;30&deg;C. Granted we have had hot weather in London recently, but it was not as hot, and unpredictably mixed up in a traditionally British way, with intermittent overcasting clouds and thunder storms.</p><p>The second thing to notice is that many buildings in Toronto are only half built. This includes the airport. International passengers were bussed from "Terminal Infield" (or perhaps this should be terminal outfield or perhaps terminal in field<nobr> <wbr></nobr>:), to the main terminal building where immigration and customs etc. are. Having done the necessary stuff here including retrieving my luggage, I find that there is no bar in the building. So I take a taxi to 89 Chestnut - the conference venue which is also where I'm staying.</p><p>There's no bar in this building either - it is a student residence, but the security man recommends Mr. Greenjeans which is inside a mall called the Eaton Centre. The idea of a pub inside a shopping mall does not appeal, as this combination in England is a recipe for disaster, but this bar seems OK.</p><p>Today I've been exploring and getting other matters sorted out like the right kind of adapter plug to use with my laptop, and internet access from my room (I'm using this to post this journal).</p><p>The feeling of Toronto is quite cosmopolitan - most of the shops here seem to be run by Asians: Chinese or Indians. It was an Indian shop that was able to help with getting me the right mains plug adaptor.</p><p>Looking forward to the conference. Will see how it pans out. May post more perlish journals if I get the urge.</p> ivorw 2005-06-26T21:43:56+00:00 journal fixin them shebangs http://use.perl.org/~ivorw/journal/25163?from=rss <p>I have a machine with several different versions of perl on it. In particular, the default one I am wanting it to use for the present is<nobr> <wbr></nobr>/home/knoppix/ivor/stable/bin/perl</p><p>This was a relatively freshly built perl, and I found that none of the scripts worked, as they were looking for a perl in<nobr> <wbr></nobr>/usr/local/bin/perl - I deliberately did not put one there; the O/S supplied one was in<nobr> <wbr></nobr>/usr/bin/perl.</p><p>This prompted me to look into how scripts get installed. I found that ExtUtils::MM_Unix.pm has a method call fixin which becomes available through inheritance as ExtUtils::MY-&gt;fixin. Just pass in some paths of perl scripts as parameters, and they get shebangled - that's if they have a shebang line.</p><p>You can do this from the command line, in a similar fashion to how make does with exe_files:</p><p> <code> perl -MExtUtils::MY -e 'MY-&gt;fixin(@ARGV)' *.pl </code> </p><p>I've also tracked through to the Config, where it gets the information about what to put into the shebang line. This is in $Config{startperl}. If you want the scripts to be shebanged to somewhere exotic when you install them, hack Config.pm or edit config.sh (and remake your perl) to set startperl to be the correct place. You might also need to tweak perlpath in a similar way.</p> ivorw 2005-06-12T19:11:54+00:00 journal