CGI Caching is evil!!

Beatnik on 2004-01-16T10:16:08

For the past 2 days I've been looking into uploading files and sending them as attachments. Every X times, MIME::Entity would generate a broken MIME body and I would swear and curse. Apparently that server was running Apache::Registry and I'm sure that that was the cause of everything. BTW it also had an ancient version of CGI.pm. LWP::UserAgent came to the rescue for testing purposes. Submitting the form 40 times is quite easy..

#!/usr/bin/perl -w

use strict;
use LWP;

for (1..10) #Loop 10 times.. testing {
my $browser = LWP::UserAgent->new; #Instantiate
my $response = $browser->post('http://www.host.com/cgi-bin/script.pl',
['session'=>'vTLHmbtajJjmyjVBjzFEQuSKoLQQijDo', #Field 1
'attach'=>["local_filename"=>"remote_filename"], #File to upload, attach is a field of type file
],
'Content_Type'=>'form-data' #Needed for multiparts
);

#print $response->content; #Print the returned page
print "Loop $_\n";
}