[tpm] Problem with WWW::Mechanize in Dancer
Alex Beamish
talexb at gmail.com
Fri Apr 8 08:45:01 PDT 2011
Hi Bobby,
Some stylistic comments ..
[] I always cringe when I see shift used to take stuff off the
parameter list .. even if it's for a single argument, I prefer .. my (
$url ) = @_ ..
[] WWW::Mech is a great module, but I'm not sure why you need to use
it, rather than LWP::UserAgent, which it inherits. Simple is better --
but I have no idea if that would solve the hanging problem.
[] After calling WWW::Mech, you're not testing whether you got a good
browser object back .. might be good to check that.
[] Try::Tiny is a nice alternative to eval .. just be aware if you use
that module that the error ends up in $_, not $@.
I assume you're not able to look at the web server where your request
is going .. but if you are, the server logs might give you some
insight.
Good luck!
--
Alex Beamish
Toronto, Ontario
aka talexb
More information about the toronto-pm
mailing list