emazep's Journal http://use.perl.org/~emazep/journal/ emazep'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:35:14+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 emazep's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~emazep/journal/ ref never returns undef! http://use.perl.org/~emazep/journal/31432?from=rss Since I keep on finding here and there tests like this:<blockquote><div><p> <tt>if (defined ref $thingy<nobr> <wbr></nobr>...</tt></p></div> </blockquote><p>let me point out that <code>ref</code> <strong>never</strong> returns <code>undef</code>. If its argument is not a reference, <code>ref</code> simply returns the empty string (even if called on <code>undef</code>!) </p><p> To have an idea on what I'm talking about (and on how common this redundant - and sometimes completely wrong - test is), have a look at <a href="http://www.google.com/codesearch?q=+lang:perl+if%5Cs*%5C(*%5Cs*defined%5Cs*%5C(%3F%5Cs*ref&amp;sa=N">here</a>.<br> And to have a confirmation that a test like this is really superfluous (at best), have a look at the <a href="http://perldoc.perl.org/functions/ref.html">docs</a>. </p><p> <strong>Update</strong> </p><p> <a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=lang%3Aperl+defined%5Cs*%5C(%3F%5Cs*ref&amp;btnG=Search">Here</a> is a slightly better crafted search - which searches just for the pattern <code>defined\s*\(?\s*ref</code> - which gives more results (though some of them are not pertinent to be honest). </p><p> Anyway thank everyone for the clarification about the origin of this meme (though now I have the same n1vux's curiosity<nobr> <wbr></nobr>;-) </p><p> Ciao, Emanuele.</p> emazep 2006-10-27T02:33:23+00:00 journal EU plan could put open sourcers in jail http://use.perl.org/~emazep/journal/26061?from=rss <p> Great! </p><p> It's getting <a href="http://news.zdnet.com/2100-3513_22-5815584.html?tag=nl.e589">better and better</a> day by day! </p><p> Emanuele.</p> emazep 2005-08-03T11:34:58+00:00 journal The Stupidest Lawsuit Since the World Began http://use.perl.org/~emazep/journal/25972?from=rss <p> No, we Europeans aren't any better. <br> Nay, we're <a href="http://www.groklaw.net/article.php?story=20050712045953910">even worse</a>, if possible. </p><p> Mala tempora currunt! </p><p> Emanuele.</p> emazep 2005-07-30T09:04:47+00:00 journal Microsoft patents the Emoticons http://use.perl.org/~emazep/journal/25971?from=rss <p> Or at least they <a href="http://www.groklaw.net/article.php?story=20050724140820490">try to do it</a>. <br> I'm sure they will succeed, given the American patent law (sideways swinging on a swing is patented in the Land of Freedom). </p><p> O tempora, o mores! </p><p> Emanuele.</p> emazep 2005-07-30T08:56:43+00:00 journal "Perl can't create advanced client side applications"?! http://use.perl.org/~emazep/journal/25970?from=rss <p> I would certainly strongly disagree with a statement like this. But I would disagree even more if, to support such a statement, one gave a reason like this:</p><blockquote><div><p> <cite> True. There are some client side Perl solutions like PerlScript in MSIE 5.0, but all client side Perl requires the user to have the Perl interpreter on their local machine. Most users do not have a Perl interpreter on their local machine. Most Perl programmers who need to create an advanced client side application use Java as their client side programming language and Perl as the server side solution. </cite></p></div> </blockquote><p> So, what the heck, Java applications do require the user to have the JRE (and sometimes even the full JDK) on their local machine, don't they?! </p><p> Not to mention the size of the interpreter to download: on Windows for example (as we're talking about casual users) the JVM 5.0 is 15.5 MB and the JDK over 127 MB, while we have (free) dummy-proof Perl installers like ActiveState's Active Perl 5.8.7.813 which is just 12.7 MB (also bundled with many modules, docs and extra tools). </p><p> Not to mention that sometimes the Java user has to keep several different versions of the JVM, because of its lack of backwards compatibility, with the resulting CLASSPATH madness and headaches. </p><p> Not to mention that Perl offers tools like PAR, TinyPerl or PerlBin (just to limit the list to the free ones) that turn your Perl programs into single executables, by embedding perl itself and all the required modules into a single file, thus disproving the mentioned claim about the necessity to have the Perl interpreter installed on the user machine. A bright, real example of a successful advanced Perl client application, that you can download, install in a snap on Windows and use instantly without having Perl pre-installed is <a href="http://popfile.sourceforge.net/">POPFile</a> (it even contains an embedded HTTP server, to offer an HTML-based UI). </p><p> Not to mention that a couple of running Java applications can easily kill the user machine. </p><p> Not to mention that Perl is far more portable across different hardware and OSes than Java. </p><p> Not to mention a bunch of other things... </p><p> So, who could ever make a statement like the above mentioned one? Some Java taliban? Scott McNealy or Jonathan Schwartz?<br> No my friends, that statement, sadly, appears <a href="http://perl.apache.org/docs/general/perl_myth/perl_myth.html#Perl_can_t_create_advanced_client_side_applications"> here</a>, on a document entitled <b>Popular Perl Complaints and Myths</b>, supposedly published as <code>mod_perl</code> (and Perl in general) advocacy material, written by some of the most reputable Perl programmers around. </p><p> I certainly don't want to fight every opinion adverse to Perl, and I for myself as a programmer, often use languages other than Perl (yes, even Java). But I couldn't omit to counter a foolishness like that. </p><p> Emanuele.</p> emazep 2005-07-30T07:14:28+00:00 journal