Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:50:59+00:00 2026-05-25T00:50:59+00:00

We have a custom site written in Perl that uses a slightly modified version

  • 0

We have a custom site written in Perl that uses a slightly modified version of CGI.pm. During server updates, CGI.pm may be overwritten when it is updated. My goal is to be able to update the server without affecting the site – i.e. change the code that relies on the modified CGI.pm. Unfortunately I am not very familiar with Perl syntax or best practice.

Here is a diff of the modified CGI.pmn (line numbers are off from the most recent version of CGI.pm):

--- CGI.pm.orig Tue Nov  7 12:14:09 2006
+++ CGI.pm      Tue Nov  7 12:13:29 2006
@@ -3386,7 +3386,7 @@ sub read_multipart {
               if (defined $self->{'.upload_hook'})
                {
                   $totalbytes += length($data);
-                   &{$self->{'.upload_hook'}}($filename ,$data, $totalbytes, $self->{'.upload_data'});
+                   &{$self->{'.upload_hook'}}($filename ,$data, $totalbytes, $self->{'.upload_data'}, $param, $header{'Content-Type'});
               }
               print $filehandle $data if ($self->{'use_tempfile'});
           }

The code that relies on this diff follows:

my %file_hash = ();
my $page = new CGI(\&file_reader, \%file_hash, 0);

my $session = &get_session($page);


foreach my $param_name (keys %file_hash) {
        my $notes_param = $param_name . "_notes";
        &store_file($file_hash{$param_name}, $page->param($notes_param),
                    &get_session_name($session));
}

Without the diff, when the file is stored, the $param_name variable appears to be empty.

What is the best way to handle this? As I said before, my main goal is to simplify updates to the server; is there some way to either

a) (preferably) get %file_hash to work properly without a modified version of CGI.pm
b) prevent updates to CGI.pm (and is this a bad idea)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:51:00+00:00Added an answer on May 25, 2026 at 12:51 am

    Have you tried submitting this to the CGI RT as a desired improvement? It seems reasonable to pass $param and \%header (rather than $header{'Content-Type'}) to the callback.

    To answer your question, you could install CGI in a local directory. The directories in the PERL5LIB env var are searched first, so your CGI version would be found instead of the one installed by the Ubuntu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dot net nuke site that I have written a custom module
simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is
Let's say that I have written a custom e-mail management application for the company
I have a custom built CRM that is 99% written in Classic ASP/VBScript. Currently
I have a custom site definition which includes a form library. I have a
I have around ~40 custom modules and a custom skin on a DotNetNuke site
I have a site using a custom favicon.ico. The favicon displays as expected in
I currently have a web site where users can select a custom theme. After
I'm trying to return a custom 404 page using IIS6. (I have a site
I have custom classes that I currently instantiate within App.xaml as resources. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.