Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Beatnik (493)

Beatnik
  (email not shown publicly)
http://www.ldl48.org/

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [sf.net], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Friday January 16, 2004
05:16 AM

CGI Caching is evil!!

[ #16858 ]
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";
}
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.