in reply to submitting files to a cgi

You are probably destroying the filehandle/filename duality of $file_contents by applying the regex to it, but I don't really know as I've always stuck to using strict and doing something like.
my $fh = $query->upload('uploaded_file'); # ... while(<$fh>) { # ... }
Why are you writing a while loop when you're slurping the file anyway? It will suffice to
my $data = do { local $/; <$fh> };

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: submitting files to a cgi
by Anonymous Monk on Jan 29, 2003 at 10:39 UTC
    Hi monks, I am still having real problems uploading the contents of a file from a CGI. I have made alterations to my code based on the suggestions but mothing works. There is no problem with the file, just nothing prints to the screen. Any other suggestions would be much appreciated. ;-)