kingubu's Friends' Journals http://use.perl.org/~kingubu/journal/friends/ kingubu's Friends' use Perl Journals en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:20:46+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 kingubu's Friends' Journals http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~kingubu/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> Matts 2010-01-26T10:31:17+00:00 journal Time::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> Matts 2010-01-25T23:23:53+00:00 journal Warning 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>&nbsp; &nbsp; 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> Matts 2010-01-04T22:13:57+00:00 journal Perl Oasis 2010: Schedule Posted http://use.perl.org/~perigrin/journal/40050?from=rss <p>The Perl Oasis team would like to announce <a href="http://perloasis.org/opw2010/schedule">the Schedule</a> has been posted for Perl Oasis 2010. We have 15 speakers from 3 continents giving 9 hours of talks, culimating in a keynote by the Enlightened Perl Organisation Secretary Mark Keating (mdk).</p><p>Perl Oasis is a one day workshop focusing on Modern Enlightened Perl. The workshop this year is held January 16th at the Four Points Sheraton in Orlando Florida. Workshop registration costs $20 USD for non-students, and $10 USD for students. Every one is welcome to attend regardless of race, creed, ethnicity, gender, or preference of language (There are even PHP people speaking!)</p> perigrin 2009-12-24T07:10:54+00:00 journal Perl Oasis 2010: Discount Hotel Rates End http://use.perl.org/~perigrin/journal/39944?from=rss <p>November 25th is the last day for the Perl Oasis special Group Rate. The rate is $75 USD / night for what according to other sources is a $135-$150 / night hotel room.</p><p>Perl Oasis is a one day workshop in Orlando Florida focusing on Modern Enlightened Perl. This year we have speakers from three continents, and the entire Perl spectrum speaking. The Call for Speakers is still open so you can <a href="http://perloasis.org/opw2010/newtalk">submit your talk as</a> well!</p><p> <a href="http://perloasis.org/opw2010/news/518">http://perloasis.org/opw2010/news/518</a></p> perigrin 2009-11-25T01:48:30+00:00 journal still kicking after 7 years... http://use.perl.org/~geoff/journal/39105?from=rss apparently, the <a href="http://www.modperlcookbook.org/">mod_perl cookbook</a> appears in <a href="http://www.youtube.com/watch?v=HyxIrfjla88">the new Cracker video</a>. thanks to <a href="http://use.perl.org/~perigrin/">perigrin</a> for the discovery. geoff 2009-06-09T17:38:25+00:00 journal Early 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> Matts 2009-06-02T00:05:35+00:00 journal Meta: Script to Filter the Master use.perl.org Blogs' Feed http://use.perl.org/~Shlomi+Fish/journal/38969?from=rss <p> As expected from the latest trend in the Perl blogosphere this post will be about Roles. And Moose! And Roles in Moose! And Moose in Roles! And Roles outside Moose&#8230; </p><p> Seriously now, this is a post about <a href="http://svn.berlios.de/svnroot/repos/web-cpan/XML-Feed/trunk/filter-use.perl.org/">a completely non-Moosey and non-Roley script I wrote to filter the use.perl.org master journals' feed</a>. What this script does is fetch the Atom feed of all the use.perl.org journals' posts, and filters out the entries of the use.perl.org authors that the invoker specified. </p><p> Here is out to use it. First of all: <tt>svn checkout</tt> it (or otherwise fetch it using HTTP). Then you can simply use: </p><blockquote><div><p> <tt>perl filter-use-perl-journals.pl -o everything.atom</tt></p></div> </blockquote><p> Then you can serve <tt>everything.atom</tt> with a web-server to read it using your web feeds' aggregator. </p><p> To simply create a non-filtered copy of the feed. Now let's say you want to get rid of posts from my journal (because it sucks). In that case, say: </p><blockquote><div><p> <tt>perl filter-use-perl-journals.pl -o non-shlomif.atom \<br>&nbsp; &nbsp; --blacklist="Shlomi Fish"</tt></p></div> </blockquote><p> Now, let's say you also want to get rid of <a href="http://use.perl.org/~Ovid/journal/">Ovid's</a> posts. I have no idea why you'd want to do that, because his journal is great, but it's just for the sake of the example. In that case, do: </p><blockquote><div><p> <tt>perl filter-use-perl-journals.pl -o non-shlomif-and-ovid.atom \<br>&nbsp; &nbsp; --blacklist="Shlomi Fish" --blacklist="Ovid"</tt></p></div> </blockquote><p> Finally, there's the <tt>--rand</tt> flag which is useful in case you're running the script with cron. What it does is wait for a period of time of random length, before fetching the feed, so the HTTP server would not be overloaded at regular periods. This requires a working<nobr> <wbr></nobr><tt>/dev/urandom</tt> for the time being. </p><p> The script is made available under <a href="http://en.wikipedia.org/wiki/MIT_License">the MIT/X11 Licence</a> so its use is completely unencumbered. I wrote this script today, because I have a personal use for it, but other people may find it useful too. It requires a recent version of Perl (5.8.x should be enough I think) and <a href="http://search.cpan.org/dist/XML-Feed/">XML-Feed</a>. </p> Shlomi Fish 2009-05-13T14:30:04+00:00 useperl Perl 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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gcc&nbsp; &nbsp; llvm<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---&nbsp; &nbsp; ----<br>arith/mixed&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 86<br>arith/trig&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 86<br>array/copy&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;101<br>array/foreach&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 92<br>array/index&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 93<br>array/pop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 96<br>array/shift&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 95<br>array/sort-num&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 89<br>array/sort&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;101<br>call/0arg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp;102<br>call/1arg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 89<br>call/2arg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 75<br>call/9arg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 89<br>call/empty&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 87<br>call/fib&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 90<br>call/method&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 98<br>call/wantarray&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 89<br>hash/copy&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 95<br>hash/each&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 94<br>hash/foreach-sort&nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 97<br>hash/foreach&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 91<br>hash/get&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 91<br>hash/set&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 89<br>loop/for-c&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 86<br>loop/for-range-const&nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;111<br>loop/for-range&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;116<br>loop/getline&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 96<br>loop/while-my&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 94<br>loop/while&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 96<br>re/const&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 86<br>re/w&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 89<br>startup/fewmod&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 95<br>startup/lotsofsub&nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 93<br>startup/noprog&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;101<br>string/base64&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 89<br>string/htmlparser&nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 92<br>string/index-const&nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp; 81<br>string/index-var&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100&nbsp; &nbsp; &nbsp;108<br>string/ipol&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp;103<br>string/tr&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 86<br> &nbsp; <br>AVERAGE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100&nbsp; &nbsp; &nbsp; 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> &nbsp; <br>real&nbsp; &nbsp; 40m56.599s<br>user&nbsp; &nbsp; 64m44.586s<br>sys&nbsp; &nbsp; 0m59.644s<br> &nbsp; <br>LLVM:<br> &nbsp; <br>real&nbsp; &nbsp; 45m38.831s<br>user&nbsp; &nbsp; 71m14.218s<br>sys&nbsp; &nbsp; 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> Matts 2009-04-09T17:57:03+00:00 journal What a Moose programmer would think... http://use.perl.org/~perigrin/journal/38749?from=rss <p>So I&#8217;ve been integrating Ash Berlin&#8217;s work on making <a href="http://search.cpan.org/dist/MooseX-POE">MooseX::POE</a> work with <a href="http://search.cpan.org/dist/MooseX-Declare">MooseX::Declare</a>. One of the things I came across was that the <code>method</code> keyword didn&#8217;t work as I expected.</p><p>I figured that something like:</p><p> <code>class Counter { use MooseX::POE; method START { $self-&gt;yield('increment_counter'); } event 'counter' =&gt; method { $self-&gt;counter($self-&gt;counter + 1); }; } </code> </p><p>would DWIM. But currently a <code>method</code> without a parameter list is slightly undefined. It happens to default to the same as an empty parameter list (ie <code>method ($self:) {<nobr> <wbr></nobr>... }</code>) but Florian and Ash both agreed that perhaps that wasn&#8217;t the best choice. To my mind I think that the right choice is that <code>method {<nobr> <wbr></nobr>... }</code> should be the equivlent of <code>method ($self, @_) {<nobr> <wbr></nobr>... }</code>. That is it should alias the invocant and pass through the rest of the args as a slurpy array.</p><p>Then tonight I was reading the <a href="http://use.perl.org/~chromatic/journal/38748">Perl 6 Design Minutes for 26 March 2009</a> and found the following:</p><blockquote><div><p>Patrick: </p><ul> <li>if you have a method declared without a parameter list, does it get @_ like a sub, or no parameters?</li> </ul><p>Larry: </p><ul> <li>I've been thinking it comes in the same way Perl 5 does it</li> <li>hadn't bothered to try to think about it the other way</li> </ul><p>Patrick: </p><ul> <li>Rakudo assumes @_</li> </ul><p>Larry: </p><ul> <li>but it leaves out the invocant</li> <li>that's the difference</li> <li>I haven't decided</li> <li>it's further from what a Perl 5 programmer might expect</li> <li>but it might be more useful</li> </ul></div> </blockquote><p>I think it&#8217;s closer to what a Perl 5 Moose programmer expects than Larry thinks.</p><p>UPDATED: upon talking with Ash I've clarified what I meant to say. Never blog while tired.</p> perigrin 2009-04-04T00:44:31+00:00 journal Gabor Szabo on High-Level Programming with Perl 6 on 22-Marc http://use.perl.org/~Shlomi+Fish/journal/38654?from=rss <p> The <a href="http://www.cs.tau.ac.il/telux/">Tel Aviv Open Source Club</a> will host the first part of a series of talks by <a href="http://www.szabgab.com/">G&#225;bor Szab&#243;</a> about "High-Level Programming Concepts Using Perl 6" - on 22-March-2009. </p><p> The meeting will take place at Tel Aviv University (in Tel Aviv, Israel), at the Schreiber MathsCS building, room 008 on 18:30. More information can be found <a href="http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_22_March_2009">on the meeting's page on the wiki</a>. </p><p> With any other problems, feel free to <a href="http://www.shlomifish.org/me/contact-me/">contact me</a>. </p><p> <b>Abstract</b> </p><p> High-level programming concepts using Perl 6 </p><p> A series of presentations on learning and using Perl 6 from the ground up to the special features. </p><p> Many would think that Perl 6 is just a new version of Perl and that it might only be interesting for Perl programmers. However, Perl 6 is in fact a compiled language running on a virtual machine that embraces many new concepts not found in most programming languages. </p><p> The presentations will be equally interesting for Perl, Java and C# programmers. </p><p> During the series of talks we will start by learning the basics of the language and will get to various high level concepts. For now we plan 2 sessions but if we need more time we'll schedule more meetings. </p><p> <b>Note</b> </p><p> After the talk we will go to the caf&#233; at the main entrance of the university where we can continue the discussion. If people bring portable computers, we can get the off the ground on the spot. VirtualBox images will be provided with everything that is needed for playing with Perl 6 set up inside. So you may opt to bring a computer with <a href="http://www.virtualbox.org/">VirtualBox</a> installed. </p><p> We are always looking for presentations on interesting topics. If you have an interesting idea for a talk, feel free to contact us and we'll co-ordinate a date. </p> Shlomi Fish 2009-03-17T08:51:45+00:00 events WebKit-- # breaks Catalyst::Controller::REST http://use.perl.org/~perigrin/journal/38524?from=rss <p>WebKit is has a broken Accept header, it puts text/xml and application/xml<br>first which breaks Catalyst::Action::REST&#8217;s default configuration and makes<br>the idea of being able to dispatch html/xhtml different from XML difficult at<br>best.</p><p>The reason it turns out is that the webkit developers <a href="https://bugs.webkit.org/show_bug.cgi?id=9572">cargo-culted from</a><br>Firefox, and someone in 2007 provided a <a href="https://bugs.webkit.org/show_bug.cgi?id=12296">patch</a>. The<br>response to the patch is &#8220;buh buh Firefox is doing it!&#8221;. When I tried to<br>add the comment below I discovered that their bugzilla required me to log in<br>and didn&#8217;t appear to have an option for OpenID. Because I&#8217;m loath to create<br><em>yet another</em> account to file a single comment on a bug I&#8217;ve included the text<br>here:</p><blockquote><div><p>Firefox (3.1 beta 2 at least) is no longer sending this Accept headers.</p><p> &nbsp; &nbsp; </p><p>Currently writing a REST-ful interface that renders XML different from<br> &nbsp; &nbsp; XHTML/HTML at the same URI is difficult (requires us to browser sniff and do<br> &nbsp; &nbsp; we really want to go back to that?) because Webkit based browsers will all<br> &nbsp; &nbsp; send then wrong Accept headers first. I actually ran into this while writing<br> &nbsp; &nbsp; an app that targets Android/iPhone and I had to disable my XML rendering code<br> &nbsp; &nbsp; (luckily it was a stub and not a required feature).</p><p> &nbsp; &nbsp; </p><p>Last the logic &#8220;Firefox does this&#8221; is a fallacy that I thought most people<br> &nbsp; &nbsp; were taught better by their mothers at an early age &#8230; if Firefox were to<br> &nbsp; &nbsp; jump off a bridge should WebKit too?</p></div></blockquote> perigrin 2009-02-21T23:17:06+00:00 journal Dakar 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> Matts 2009-01-19T15:10:00+00:00 journal "The Perl Future" on Heise http://use.perl.org/~Shlomi+Fish/journal/38286?from=rss <p> Piers Cawley writes about the new happenings in the Perl world in <a href="http://www.heise-online.co.uk/open/Healthcheck-Perl-The-Perl-Future--/features/112388">"Healthcheck: Perl - The Perl Future" on Heise Open Source</a>. Even though I was already aware of most of what he covers there, I found it a good read, and it is doubly recommended for people who are not following Perl news as thoroughly as I do. </p><p> Also see <a href="http://lwn.net/Articles/314514/">the LWN.net coverage</a> (where I've learned about it). </p> Shlomi Fish 2009-01-14T09:58:59+00:00 newsnews Perl Oasis: Schedule, Soirees, and Sponsor! http://use.perl.org/~perigrin/journal/38285?from=rss <p>We released our <a href="http://perloasis.org/opw2009/schedule">schedule</a> last weekend and we're a little behind on announcing it. Actually we're a little behind on everything right now, things are hectic. Please note the after-workshop Party!</p><p>Not on the schedule is a speaker's dinner on Friday Night, so if you're a speaker please know that you're welcome to attend, contact us for details on when and where.</p><p>Finally we're happy to announce that <a href="http://www.activestate.com/komodo/?utm_campaign=perloasis&amp;utm_medium=logo&amp;utm_source=perloasis&amp;utm_content=komodo&amp;utm_term=komodo">ActiveState</a> has donated some prizes for the Workshop Party Saturday night. Plans on how those will be given away will be announced Saturday. We look forward to having you all attend!</p> perigrin 2009-01-14T07:12:40+00:00 journal Perl Oasis Last Call for Talks http://use.perl.org/~perigrin/journal/38112?from=rss <p>Just a reminder,</p><p>The Perl Oasis deadline for Talk Submissions is tonight (December 17th) at Midnight (11:59pm) Eastern Time.</p><p>Please if you're thinking about submitting a talk, do so. It will make organizing the conference schedule much easier. The URL for talk submissions is http://perloasis.org/opw2009/newtalk</p><p>Thanks</p> perigrin 2008-12-17T20:08:07+00:00 journal One Week Left for Perl Oasis CfS http://use.perl.org/~perigrin/journal/38065?from=rss <p>There is only one week left in the Perl Oasis Call for Speakers. The last call<br>for speakers is December 17, 2009. Several speakers have already submitted<br>proposals and been accepted, but there is still room for more speakers. Please<br>submit soon so we can organize the schedule as quickly as possible. Talk<br>submissions can be made at <a href="http://perloasis.org/opw2009/newtalk">the</a><br>ACT site.</p><p>Perl Oasis is a one day workshop on January 17, 2009 focusing on Practical<br>Perl for Business. It is hosted by the Orlando Perl Mongers, and will be at<br>the Ramada Gateway Hotel, in Kissimmee Florida. For more information please<br>visit <a href="http://perloasis.org/">http://perloasis.org/</a>.</p> perigrin 2008-12-11T03:10:56+00:00 journal XML::RSS-1.40 - Now with a Lot of Array Goodness http://use.perl.org/~Shlomi+Fish/journal/37996?from=rss <p> After going over some of the recent and not-so-recent <a href="http://rt.cpan.org/Public/Dist/Display.html?Name=XML-RSS">XML::RSS bugs</a>, I noticed a common pattern of people wanting support for replicable XML elements. What they wanted was that when two elements with identical names were specified (in many RSS use cases where doing this would make sense), then the value pointed by the keyname would become a reference to an array instead of just concatenated together in an unhelpful manner. </p><p> In the past days, I decided to work on this meta-problem in one concentrated swoop. I naturally had to implement it in several places for both output and parsing, though tended to do them in separate commits. </p><p> <a href="http://search.cpan.org/dist/XML-RSS/">XML-RSS</a> version 1.40 contains the result of this effort. I should note that some use-cases for multiple tags probably won't do the right thing, and the internal code has garnered some ugliness. I ended up extracting some methods, but I can still be happier from the quality of code. I suppose I can always refactor it later. </p><p> All of this work reduced the number of active bugs in XML-RSS to 3, which I intend to deal with shortly, if all goes well. </p><p> In other news, I released a new version of <a href="http://search.cpan.org/dist/WWW-Search-MSN/">WWW::Search::MSN</a>, which has been adapted to the new HTML generated by the MSN search. The hardest part in the process, was figuring out how to instruct the libwww-perl that the WWW::Search front-end used to send a "Language:" header to cancel the location-based localisation. </p><p> That was my boring "recent hacktivity" report. You may now go on with whatever you did earlier. </p> Shlomi Fish 2008-12-01T17:18:58+00:00 cpan Perl Oasis - Keynote and Venue http://use.perl.org/~perigrin/journal/37939?from=rss <p>Just posted to the <a href="http://perloasis.org/">Perl Oasis Website</a>: </p><p>The Orlando Perl Mongers are pleased to announce the choice of our Keynote Speaker. <a href="http://perloasis.org/opw2009/user/2747">Mike Whitaker (Penfold)</a> will be flying in from the UK to give a keynote on <a href="http://www.enlightenedperl.org/">Enlightened Perl</a>. </p><p>Also the Venue for the conference has been chosen. The conference will be at </p><p> <a href="http://www.ramadagateway.com/">The Ramada Gateway</a> <br> 7470 Highway 192 West<br> Kissimmee, FL 34747<br> (800) 327-9170</p><p>There are rooms available at the Ramada, just tell them you're with the Perl Foundation. </p><p>We hope to see you there!</p> perigrin 2008-11-25T15:36:58+00:00 journal Why Dist-Zilla is Probably Not For Me http://use.perl.org/~Shlomi+Fish/journal/37890?from=rss <p> rjbs' <a href="http://perlbuzz.com/2008/10/distzilla-eases-management-of-your-cpan-distributions.html">introduction to Dist-Zilla</a> piqued my interest, and I used CPANPLUS-Dist-Mdv to prepare<nobr> <wbr></nobr>.rpm's for it and its depenedencies and install them. However, I wondered about a potential problem with it, before I even tried it, and speaking with rjbs on IRC confirmed that it exists. </p><p> Dist-Zilla generates the resulting<nobr> <wbr></nobr>.pm, scripts, etc. from templates, and as a result the lines that are reported by errors and warnings are not the same as the ones you've edited. This makes tracing lines back to their source much more difficult. Since most of my times is spent debugging and handling errors (whether I encounter them or I find them on CPAN testers or in bug reports), and I want to edit the source directly, I think that Dist-Zilla is not for me. What instead I'd like is a way to change common, repeated text (like version numbers, licensing, URLs, etc.) commonly across all the files in a certain distribution, or in many distributions. That and also that module-starter (or whatever) provide scaffolding for creating a new<nobr> <wbr></nobr>.pm file. </p><p> I appreciate rjbs's efforts, but I'm going to stick with module-starter (and contribute to it). </p> Shlomi Fish 2008-11-16T08:44:37+00:00 cpan Does this exist? http://use.perl.org/~perigrin/journal/37828?from=rss <p>So I was writing a package similar to DBIx::Class::Schema::Loader which creates a tree of related packages. I realized that making a directory tree from a package name is a common problem between the two and I went to look to see how Schema::Loader did it, and eek<nobr> <wbr></nobr>... there has to be a better way.</p><p>Before I release Devel::GeneratePackagePath does anybody know if the lazyweb got there first?</p> perigrin 2008-11-08T04:14:55+00:00 journal Perl Oasis 2009 - Call for Speakers http://use.perl.org/~perigrin/journal/37813?from=rss Attention Speakers! The Perl Oasis Workshop 2009 will be held in Orlando, on January 17th . We will have two tracks (advanced and beginner), and we expect approximately 100 participants. We will also try to arrange a hackaton on the Sunday after the conference. This workshop's topic is "Practical Perl for Business". We're interested in hearing about your talks on these topics: <ul> <li> Perl Success Stories</li> <li> Modern use of Perl</li> <li> Good testing practices using Perl</li> <li> Your Favorite Topic? (systems administration / life sciences / web development)</li> </ul><p> We accept these presentation types: </p><ul> <li> Short Talks (20 minutes)</li> <li> Standard Talks (40 minutes)</li> </ul><p> To submit a proposal for a talk/presentation, please register your proposed title and an abstract on http://www.perloasis.org/opw2009/newtalk. Submissions are due midnight (23:59 EST) on December 17th 2008. Submitters will be notified within two weeks whether or not their talks have been accepted. If your proposal is accepted, you will be expected to confirm within 48 hours that you in fact will give the talk; otherwise, your slot may be given to someone else. If you have something which does not fit the formats listed please feel free to contact us anyway and we will evaluate it. Please include the following with your abstract(s): </p><ul> <li> A little information about yourself (and possibly an link to an image of your choosing - preferably of yourself).</li> <li> The expected minimum level of knowledge of your target audience (Beginner, Intermediate, Advanced)</li> <li> An indication of the length of the presentation.</li> <li> A listing of any requirements you might have for doing your presentation. We will try to accommodate your request. Projectors and internet connection will be available for all talks.</li> </ul><p> If possible, please include a link to your slides/paper ready for online publishing. The files are also accepted just after talk ends, so we can include any last minute modifications. We may take the liberty of filming presentations. If you are not interested in being filmed during your presentation, please let us know in advance. We cannot offer much for your lecture, except: </p><ul> <li> Free admittance</li> <li> A chance to meet a lot of Perl people</li> </ul><p> If you have any special requests which have to do with fee and payment please contact us at info@perloasis.org. If you have any questions at all, please don't hesitate to contact us info@perloasis.org.</p> perigrin 2008-11-06T04:09:37+00:00 journal Perl 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>&nbsp; &nbsp; use POSIX qw(SIGALRM);<br>&nbsp; &nbsp; my $timeout = 30;<br>&nbsp; &nbsp; my $sigset = POSIX::SigSet-&gt;new(SIGALRM);<br>&nbsp; &nbsp; my $action = POSIX::SigAction-&gt;new(<br>&nbsp; &nbsp; &nbsp; &nbsp; sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # re-install alarm in case we were in an internal eval{} block<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alarm($timeout);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die "timeout working on: " . (caller(1))[1] . "\n";<br>&nbsp; &nbsp; &nbsp; &nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; $sigset,<br>&nbsp; &nbsp; &nbsp; &nbsp; &amp;POSIX::SA_NODEFER, # turns off safe signals<br>&nbsp; &nbsp; );<br>&nbsp; &nbsp; POSIX::sigaction(SIGALRM, $action);<br>&nbsp; &nbsp; my $prev_alarm = alarm($timeout);<br> &nbsp; <br>&nbsp; &nbsp; eval {<br>&nbsp; &nbsp; &nbsp; &nbsp; # long running code here<br>&nbsp; &nbsp; };<br>&nbsp; &nbsp; my $err = $@;<br>&nbsp; &nbsp; alarm($prev_alarm);<br>&nbsp; &nbsp; if ($err) {<br>&nbsp; &nbsp; &nbsp; &nbsp; if ($err !~<nobr> <wbr></nobr>/timeout working on:/) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die $err; # propogate this error<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; # process the timeout<br>&nbsp; &nbsp; }</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> Matts 2008-11-03T20:39:10+00:00 journal Perl Oasis http://use.perl.org/~perigrin/journal/37772?from=rss <p>The Orlando Perl Mongers are pleased to announce the Perl Oasis Workshop (aka Orlando Perl Workshop) on January 17, 2009. This is a one day workshop with a focus on Perl solving Business Problems. The website (<a href="http://perloasis.org/">http://perloasis.org</a>) is live, the venue (<a href="http://www.ramadagateway.com/">http://www.ramadagateway.com</a>) is booked, all we need now are the people! </p><p>Being that we are in Orlando, and that our venue is within a mile of the Disney Main Gates, we are hoping to have a very Family Friendly conference. If you have suggestions and ideas for events you'd like to see please get in touch with us. We hope to see you there!</p> perigrin 2008-10-31T13:29:21+00:00 journal File-Find-Object Refactoring http://use.perl.org/~Shlomi+Fish/journal/37750?from=rss <p> I haven't updated this journal in a long time, and mostly been writing in my <a href="http://community.livejournal.com/shlomif_tech/">LiveJournal Technical blog</a>. I've emailed to <a href="http://perlsphere.net/">the Perlsphere</a> maintainer about including that blog there (once from my home address and once from gmail.com), but received no reply, and so far it is not included there. </p><p> In any case, this post is about <a href="http://search.cpan.org/dist/File-Find-Object/">File-Find-Object, which is an object-oriented alternative to the core File::Find module</a>. Originally by <a href="http://search.cpan.org/~nanardon/">Nanardon</a>, I've maintained it since version 0.0.3. </p><p> Recently, I've been meaning to write a project, and contemplated whether to use File-Find-Object or roll-out my own directory traversal logic, but then decided that improving F-F-O so it will do what I want was a better idea, <a href="http://en.wikipedia.org/wiki/Eating_one's_own_dog_food">in an "Eating one's own dog food"</a> and not-re-inventing the wheel fashion. So I needed to extend F-F-O to do what I want. </p><p> While I took a closer look at the code to inspect it, I found it had some "bad smells", and decided to fix it by refactoring, as a necessary pre-requisite for extending it. </p><p> The first thing I did was notice that many methods accepted a <tt>$current</tt> parameter that was passed from one method to another, and then used. As it turned out, most of these simply originate from <tt>$self-&gt;_current()</tt>, which I now used to retrieve the value in each method, without passing a parameter. </p><p> Another fact I noticed was that there were many <tt>if ($self eq $current)</tt> checks in the code. Since <tt>$current</tt> is dynamic, I decided to create a predicate <tt>_is_top()</tt> which will encapsulate it and to create the following method maker: </p><blockquote><div><p> <tt>sub _top_it<br>{<br>&nbsp; &nbsp; my ($pkg, $methods) = @_;<br> <br>&nbsp; &nbsp; no strict 'refs';<br>&nbsp; &nbsp; foreach my $method (@$methods)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; *{$pkg."::".$method} =<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $m = $method;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $top = "_top_$m";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $non = "_non_top_$m";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $self-&gt;_is_top()<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? $self-&gt;$top(@_)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : $self-&gt;$non(@_)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; }<br> <br>&nbsp; &nbsp; return;<br>}</tt></p></div> </blockquote><p> Thus, when _is_top evaluates to true I call <tt>_top_mymethod</tt> and otherwise <tt>_non_top_mymethod</tt>. This is a variation on the <a href="http://sourcemaking.com/refactoring/replace-conditional-with-polymorphism">"replace conditional with polymorphism" refactoring</a>. </p><p> Now <tt>-&gt;_current()</tt> returned the <tt>-&gt;_current_idx()</tt>'th item from an internal stack representing the directories which the object is traversing. I wanted to see where "_current_idx" was set and discovered it was incremented when an item was pushed to the stack, and decremented when an item was popped. As a result, I eliminated "_current_idx" completely and replaced <tt>_current()</tt> with <tt>$self-&gt;_dir_stack()-&gt;[-1]</tt>. That removed a lot of cruft from the code. </p><p> I also was able to do what I wanted, and make sure the paths are maintained as the base path for the traversal followed by a list of extra components of each inner directory. </p><p> I noticed that I flat-copied the return of a method returning an array reference several times (E.g: <tt>[ @{$self-&gt;_components()} ]</tt>) and so created another method maker - this time for "_copy" methods. </p><p> And naturally, I extracted many methods. </p><p> All this enabled me to create <tt>-&gt;next_obj()</tt> and <tt>-&gt;item_obj()</tt> API methods that return objects instead of plain strings. Naturally, this is not refactoring, but extending. </p><p> While I was in the neighbourhood, I discovered that <a href="http://www.securiteam.com/unixfocus/6S00L20MUE.html">the code had a format-string-issue</a>, which I fixed, and released File-Find-Object-0.1.1 immediately. </p><p> After the release, I received three failure reports from CPAN Testers. Two of them were for a missing dependency, that wasn't installed due to a bug in the tests' smoking setup. One of them, however, was for Win32, where it was a real bug. I was able to reproduce it using Strawberry Perl on my WinXP computer, and released File-Find-Object-0.1.2 that corrected it. The problem was that on non-cygwin-Win32 all inodes are returned as 0 in the calls to stat(). </p><p> Today, I started writing the project that required all this work on File-Find-Object. So far it doesn't do much, but it's a start. </p> Shlomi Fish 2008-10-27T18:34:38+00:00 cpan Missing in ACTion http://use.perl.org/~perigrin/journal/37720?from=rss <p>Has anybody seen the ACT (http://act.mongueurs.net/) maintainers, It's been over two weeks since I started asking about how to make the Perl Oasis (http://www.perloasis.org) workshop go live, and the last 5 emails have gone off never to be heard from again. I'm also starting to hear from others that they're having issues with SVN and updating files on their live sites.</p><p>Has anybody seen Eric Cholet(Echo)? Should we send out a search party to his last known coordinates?</p><p>UPDATE:</p><p>BooK has responded on the ACT mailing list saying it as I feared. Real Life has gotten him. Also I don't want to imply that SVN is broken for *everyone*. I've just heard reports from one specific group of people who were having issues, but since their workshop is before mine I figured it behooved me to help figure out what's going on. Thank you for those who have responded.</p> perigrin 2008-10-23T14:40:55+00:00 journal Orlando.PM Social Tonight http://use.perl.org/~perigrin/journal/37661?from=rss <p>Just a reminder tonight is our first Social meeting at 7pm. We're meeting Downtown tonight, at the Harp and Celt.</p><p>To quote Charles (who chose the venue):<br>---</p><p>I have chosen The Celt (the bar portion of The Harp and Celt) downtown.</p><p>http://www.harpandcelt.com/TheCelt.html</p><p>This is a small Irish bar that has food and drinks. I have eaten there, the food is good. It is also close to a few other places if we want to migrate. Nearby there is Crooked Bayou, Central Station Pub, AKA Lounge, Casey's, Cleo's, Suite B, and is only a block away from Wall Street Plaza. There is a garage you can park in on Central between Magnolia and Rosalind or you can hunt around for a free spot. Parking should be free in any metered parking spot.</p><p>----</p> perigrin 2008-10-14T13:27:10+00:00 journal OSDClub Tel Aviv Meeting: Ori Idan about the Semantic Web http://use.perl.org/~Shlomi+Fish/journal/37483?from=rss <p> <a href="http://www.cs.tau.ac.il/telux/">The Tel Aviv Open Source Developers Club (OSDClub)</a> (formerly the Tel Aviv Linux Club and other clubs such as Perl-Israel) will hold <a href="http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_September_2008">a meeting on 21/September (next Sunday)</a>. Ori Idan will deliver a presentation about <a href="http://en.wikipedia.org/wiki/Semantic_Web">the Semantic Web</a>. </p><p> Ori is the director of the Israeli branch of the World-Wide-Web Consortium (W3C), and is a very good presenter, so it is recommended to attend. </p><p> The meeting will take place at 18:30 in the Schreiber Maths and Computer Science building of Tel Aviv University, room 008. Attendance is free of charge and everyone are welcome. </p> Shlomi Fish 2008-09-18T14:24:08+00:00 events Resolution for maintperl-5.8.x's IPC::SysV failure http://use.perl.org/~Shlomi+Fish/journal/37346?from=rss <p> As a followup to <a href="http://use.perl.org/~Shlomi+Fish/journal/37138">this post about "make test in maintperl-5.8.x Fails on Linux"</a>, I should note that <a href="http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00079.html">we have investigated it on perl5-porters</a> in the past days. After a little investigation, I realised that there was a stray "SysV.pm" file in my perl-5.8.x tree, which caused all the problems. </p><p> As it turned out, it was not removed because I used "rsync -auvz" to synchronise the tree (as instructed in <a href="http://dev.perl.org/perl5/docs/p5p-faq.html">the perl5-porters FAQ</a>) instead of "rsync -auvz --delete-after", which removes the no-longer present files. After running rsync with <tt>--delete-after</tt>, and building again - "make test" was successful. </p><p> "Another crisis was solved!". </p> Shlomi Fish 2008-09-04T12:11:52+00:00 bugs More Ubiquity http://use.perl.org/~perigrin/journal/37300?from=rss <p>So I&#8217;ve been playing with <a href="http://wiki.mozilla.org/Labs/Ubiquity">ubiquity</a> some more. Because all of the code runs in chrome:// space in firefox, you get to run as a first class citizen on the computer. Unfortunately this means if you want to do anything fun you need to deal with XPCOM.</p><p>Tonight I stole some code from <a href="http://developer.mozilla.org/En/Code_snippets:Running_applications">developer.mozilla.org</a> and came up with the following (only works/tested on a Mac):</p><p><code><br>function system(cmd, args) {<nobr> <wbr></nobr>// create an nsILocalFile for the executable<br> &nbsp; &nbsp; &nbsp; &nbsp; var file = Components.classes["@mozilla.org/file/local;1"]<nobr> <wbr></nobr>.createInstance(Components.interfaces.nsILocalFile);<br> &nbsp; &nbsp; &nbsp; &nbsp; file.initWithPath(cmd);<nobr> <wbr></nobr>// create an nsIProcess<br> &nbsp; &nbsp; &nbsp; &nbsp; var process = Components.classes["@mozilla.org/process/util;1"]<nobr> <wbr></nobr>.createInstance(Components.interfaces.nsIProcess);<br> &nbsp; &nbsp; &nbsp; &nbsp; process.init(file);<nobr> <wbr></nobr>// Run the process.<nobr> <wbr></nobr>// If first param is true, calling thread will be blocked until<nobr> <wbr></nobr>// called process terminates.<nobr> <wbr></nobr>// Second and third params are used to pass command-line arguments<nobr> <wbr></nobr>// to the process.<br> &nbsp; &nbsp; &nbsp; &nbsp; process.run(false, args, args.length);<br>}</code></p><p><code>CmdUtils.CreateCommand({<br> &nbsp; &nbsp; name: "say",<br> &nbsp; &nbsp; takes: {"your shout": noun_arb_text},<br> &nbsp; &nbsp; preview: function( pblock, theShout ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; pblock.innerHTML = "Will echo: " + theShout.text;<br> &nbsp; &nbsp; },<br> &nbsp; &nbsp; execute: function( theShout ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system('/usr/bin/say', [theShout.text]);<br> &nbsp; &nbsp; },<br>})<br></code></p><p>This will run text-to-speech on whatever test you input (either via typing or that is selected in the browser) by using the <code>say</code> command on OSX. The important part though is not what it does, it is what it <em>can do</em>. This opens up all of CPAN to Ubiquity.</p><p>I think I&#8217;m gonna have some fun now.</p> perigrin 2008-08-29T03:38:59+00:00 journal