Ovid's JournalOvid's use Perl JournalDear LazyWeb, How Does Twitter Do It- June 28, 2008 How the hell does Twitter make money I'm completely stumped. I assumed it was plastered with ads, so I turned off adblock.Nope. No ads. What the hellhttp://use.perl.org/~Ovid/journal/36803?from=rss Overriding Methods with Non-Existent Methods- June 26, 2008 Today I spent a few hours trying to nail down a nasty bug. Once I could replicate a small test case, what finally clued me in was an error message that looked impossible, but I remembered seeing it somewhere before. I just couldn't remember where. Consider this: if ($c->user $c->authenticate(undef, 'Pips Realm')) That was failing with "Undefined subroutine &Pips3::user called at ..."Wait! What I didn't call a subroutine. I called a method! What the hell is going onFor our...http://use.perl.org/~Ovid/journal/36789?from=rss "make perl6" on OS X- June 25, 2008 If you want to build and run Perl 6 today, you first check out parrot: svn co https:svn.perl.orgparrottrunk parrot A basic incantation for then building Perl 6 would be as follows (doing this from memory, so let me know if I've goofed): $ cd parrotperl Configure.pl && make testcd languagesperl6make perl6 && .perl6 -e 'say "Hello, World!"' I was getting plenty of strange failures with make perl6 until chromatic pointed out that I likely had a previous parrot installed on my...http://use.perl.org/~Ovid/journal/36776?from=rss Painful, painful bug- June 24, 2008 jplindstrom asked me if I had run the tests since they were failing. Of course I ran them! I had no idea how they were failing now when they passed a few minutes earlier. However, with lots to do that day, I forgot about it. Then today it happened again. There were some tests which failed when run individually, but were passing when run via Test::Aggregate. I was worried that there was a bug in my module, but it turns out to be a real bug which was spotted:Here was my test case: ...http://use.perl.org/~Ovid/journal/36767?from=rss Easy Text Tables!- June 24, 2008 I really like the Text::Table module, but its use can be a bit cryptic at times. A basic table can look like this: Time Test18m 12s tacceptance.t4m 17s taggregate.t2m 12s tunitapispider_and_validate.t0m 53s tstandardsuse.t0m 21s tsystembothimportlogsearch.t0m 20s tsystembothimportlogpager.t0m 18s ttest_class_tests.t0m 16s tunitdbmigrations.t0m 14s tunitpiptestpprovetestdb.t0m 12s tsystembothimportloglog.t That's nice and all,...http://use.perl.org/~Ovid/journal/36762?from=rss Test::Aggregate versus Test::Class- June 24, 2008 Still working on Test::Aggregate, but so far it works well. Currently we have tests which would normally take 13m25s running in 4m17s. I call that a win.Regrettably, this might kill Test::Class adoption for us. Test::Class also runs the code in a single process, but the inherited tests push the test time up to an unacceptable level. This is disappointing to me as I would love to convert almost all of our tests over to Test::Class. It's one of the best test modules out there.http://use.perl.org/~Ovid/journal/36761?from=rss Data::Dumper::Overload- June 23, 2008 Dear Lazyweb: tell me that there's a Data::Dumper (or better yet, Data::Dump::Streamer) alternative that allows me to respect string overloading. Specifically, I need to have a Data::Dumper-like module which accepts a hashref of which overloaded modules to respect for string overloading (sometimes I want all, sometimes I want none). Or better still, a callback system whereby I can specify how a particular data structure gets represented when dumped. I hack together the following, but it was.http://use.perl.org/~Ovid/journal/36753?from=rss IBM Developerworks: FAIL!!!- June 23, 2008 When I sign up for a new Web site, I use a strong password. A random password. Something that is unguessable and impossible for me to memorize. That's annoying, but it's important. I also discover all sorts of issues with Web sites as a result.Today's issue was discovering three problems in one with signing up for IBM Developer Works: Their "minimum eight character" password field doesn't explain which characters are legal.Their rejection of my strong password doesn't tell me why it was...http://use.perl.org/~Ovid/journal/36747?from=rss I Didn't Want to See That- June 23, 2008 One thing I found unsettling was running this over our CPAN install: ack 'sexitb' libperl5 Admittedly, many of those were false positives, but not all of them were. This puzzles me. Even if it's clearly documented, this is a very dangerous practice. How do I cleanly write code for something which might call exit() Do I have to remember to override exit() every time Yuck. What this means is that the module author has taken it upon themselves to deny me control over my use of the...http://use.perl.org/~Ovid/journal/36746?from=rss The Test::Most From HELL!- June 20, 2008 So far Test::Most has garnered me nothing but kudos. People love the fine-grained control over their test suites and now it makes plans almost irrelevant. However, here's what it exports into your namespace: TODOBAIL_OUTallall_doneanyarrayarray_eacharrayelementsonlyarrayl engtharraylengthonlybagbail_on_failblessedboolcan_okcmp_bagcmp_d eeplycmp_methodscmp_okcmp_setcodediagdie_on_faildies_okeq_array eq_deeplyeq_hasheq_or_diffeq_or_diffeq_or_diff_dataeq_or_diff_datae...http://use.perl.org/~Ovid/journal/36738?from=rss |