NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
A question re: the article (Score:1)
Very nice article, I liked it.
A question, though: I admit I don't understand all the magic behind overloading constants, but shouldn't the example on page 2
be testing the result of the constructor call withdefined()? Is it possible, with all the overloading going on, that the result ofnew('0/1')would be interpreted as a number 0 and thus appear to fail?about the article (Score:1)
The article had some very nice examples in it, especially for the use of constant overloading. I used to think that was only good for confusing your coworkers with "zero but true"-hacks.
I'm not sure your arguments hold true, that the code would be less clean in Java. Having multiple methods would be much nicer in my opionion. Maybe it's just me, but I think that
elsifis one of the ugliest constructs ever invented (right after the switch statement).I know that its not possible in Perl, but I think its