in reply to How can I open a filehandle so it is cleared and rewritten for every request?

It might help us to show us the program you have, or a small relevant portion of it. Tell us what it's doing now, and how that's different from what you want it to do. It might help for you to read How do I post a question effectively? and/or PerlMonks FAQ and/or How (Not) To Ask A Question

  • Comment on Re: How can I open a filehandle so it is cleared and rewritten for every request?

Replies are listed 'Best First'.
Re^2: How can I open a filehandle so it is cleared and rewritten for every request?
by skrapasor (Novice) on Jun 27, 2008 at 19:00 UTC
    I didn't post my code because it's exactly the same as the link I provided, but here it is:
    my $response_data; my $response_header; open(my $RD, ">", \$response_data); open(my $RH, ">", \$response_header); $curl->setopt(CURLOPT_WRITEDATA, $RD); $curl->setopt(CURLOPT_HEADERDATA, $RH); $curl->perform; print "Response header: $response_header\n"; print "Response body: $response_body\n";
    I want $response_data to be rewritten every time I run curl->perform, is there a way to do that?