<div>Thanks Alex.</div><div><br></div><div>In this instance, I was just playing around to see if I could make the RPC call to itself.  Using subs as Flavio suggested (on the Dancer list) removes the need to make the RPC call, but it would have been neat to write the UI components using the API as it was intended, even if it was within the same application.</div>
<div><br></div><div>The guys on the Dancer list were saying this isn't how it should be used (Dancer RPC calls should not be made to itself, and that this is what's causing the hang).</div><div><br></div><div>I removed a bunch of debug statements to make the code easier to read (on pastebin), but I I had some code in there to check the browser->get() object.</div>
<div><br></div><div>Never used Try::Tiny, so will have to take a look at that; and I've used Mechanize a few times before so it just seemed natural, but I'll look at LWP::UserAgent as well.</div><div><br></div><div>
I know better about shifting off @_, but old habits die hard :\   </div><div><br></div><div>Thanks very much for the feedback and suggestions, very much appreciated.</div><div><br></div><div>-Bobby</div><div><br></div><br>
<div class="gmail_quote">On Fri, Apr 8, 2011 at 11:45 AM, Alex Beamish <span dir="ltr"><<a href="mailto:talexb@gmail.com">talexb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Bobby,<br>
<br>
Some stylistic comments ..<br>
<br>
[] I always cringe when I see shift used to take stuff off the<br>
parameter list .. even if it's for a single argument, I prefer .. my (<br>
$url ) = @_ ..<br>
<br>
[] WWW::Mech is a great module, but I'm not sure why you need to use<br>
it, rather than LWP::UserAgent, which it inherits. Simple is better --<br>
but I have no idea if that would solve the hanging problem.<br>
<br>
[] After calling WWW::Mech, you're not testing whether you got a good<br>
browser object back .. might be good to check that.<br>
<br>
[] Try::Tiny is a nice alternative to eval .. just be aware if you use<br>
that module that the error ends up in $_, not $@.<br>
<br>
I assume you're not able to look at the web server where your request<br>
is going .. but if you are, the server logs might give you some<br>
insight.<br>
<br>
Good luck!<br>
<font color="#888888"><br>
--<br>
Alex Beamish<br>
Toronto, Ontario<br>
aka talexb<br>
</font></blockquote></div><br>