in reply to LWP::UserAgent returns hash ref with post [SOLVED]

What does
print ref $r;
output after the post call in both situations? Or, even better, use Data::Dumper and try to
print Dumper $r;
in both contexts.

Replies are listed 'Best First'.
Re^2: LWP::UserAgent returns hash ref with post
by halfcountplus (Hermit) on Apr 22, 2010 at 14:38 UTC
    It's a HTTP::Response object, and I know what's in it (that's the point of the while $k $v bit).

    That's not the issue...

    One node of the hash is "_content" (a scalar/string). I'm curious as to why when this is used in a script, $r is the _content string, but here in a module function it is the entire HTTP::Response bless'd hash. Again, the code is otherwise identical.

    Whoops! No it's not...I was using:
    print "\n".$resp->content();
    In the script. Heh-heh.