LWP::Online 0.01: I hope this doesn't blow up in my face...

Alias on 2006-09-30T16:53:37

In my "Nothing Can Possibly Go Wrong Talk" from YAPC::NA, one of the items I spend a good chunk of time on is "The Open Problem".

In short, when writing Open Source code, don't try to solve problems with open ended scopes, like "Search the Internet", because you can't just write a solution and move on, it requires constant work.

It has the potential to be the sort of module (like PAR or ExtUtils::MakeMaker and so on) that simply suck the life out of the author and kill their release rate for new modules dramatically, because of the continuous distractions on the large thing.

Unless anyone can show me an existing solution, today I'm breaking this rule and I'm uploading LWP::Online, which is an (intially at least) small module that uses LWP to try to answer the question "Is the Intarweb working?".

I intend to use it in things like test scripts, to try and auto-detect whether to run tests that use remote systems or whether to skip them, and similar uses.

My hope it that in breaking the rule and trying to solve an Open Problem, I'm at least mitigating some of the worst of it by only solving things LWP can see, so at least I'm not going to blow out the dependencies of this thing should it get larger.

The initial version works, but is currently a little slow if you are offline, because I don't shorten the timeouts on anything (yet).

Any comments people have would be greatly welcome.


Test::Online?

miyagawa on 2006-10-01T05:49:18

I've got a similar code on Plagger's Unit test library http://plagger.org/trac/browser/trunk/plagger/t/TestPlagger.pm#L72 to skip the whole test if network's not available.