URAvgDeveloper101 has asked for the wisdom of the Perl Monks concerning the following question:
All, First off, This is my first posting here and I'd consider myself an intermediate Perl user at best, so don't be surprised by my ignorance on this. Now on to the question:
I have a script where I am posting a GET request using HTTP::Request and the LWP::UserAgent module. I get my response with:
$response = $ua->request($request);
I am able to print the content to stdout with:
print $response->content;
HOWEVER, I cannot print this to a file. When I try to print the contents to file I get an empty file. What I am really trying to do is access the content data from a calling C program with popen, but that does not work since nothing is going to stdout (at least from what I can tell).
I figured that if I am able to print the content to stdout as above then it is essentially, "What you see is what you get". I am inclined to believe I am missing something. Namely, some kind of encoding that Perl makes transparent to the user when they call a simple print command from within the script?
PLEASE help as I have been pulling my hair out half the day over this stupid thing and I know I am missing something relatively trivial. THANK YOU.
|
|---|