Bug 2845 - Perl cgi-bin bug
Perl cgi-bin bug
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Crutcher Dunnavant
Depends On:
  Show dependency treegraph
Reported: 1999-05-15 17:15 EDT by aftab
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-08-29 22:33:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description aftab 1999-05-15 17:15:04 EDT
I have recently installed Redhat Linux, and when I copied
my web page from my PC to linux, it did not execute the
scripts properly. I have also updated my perl version with
the latest update on you web site (14/05/99)and still had
the same problem. After some debugging I have found what
the problem is: I pass a reference to an associate array to
a subroutine. This subroutine then fills in this array. But
the items this subroutine enters into the array are not
visable outside this array as they should be as I passed
the array by reference. These scripts have been working on
my PC and on ISP unix machine. The contenets of the script
are below.



#the login_form is empty it does not get filled as it should

$userid = $login_form{'userid'};
$pass = $login_form{'pass'};

#the subroutine
sub parse_input {
	if (defined(@_)) {
	else {
	local ($temp,@pairs);
	if (&form_method eq 'POST') {
	else {
	if ($temp ne '') {
		foreach $item(@pairs) {
			($key,$content)=split (/=/,$item,2);
			$content=~tr/+/ /;
			$content=~ s/%(..)/pack("c",hex
			if (!defined($input{$key})) {
			else {
				$input{$key} .= "\0
		return 1;
	else {
		return 0;
Comment 1 Cristian Gafton 1999-08-29 22:33:59 EDT
You can change the perl fucntion to return the actual array instead
of 	playing the by-refreence game, whcih is totally evil. At a first
fast glance I got scaried by things like
	$input{$key} .= "\0$content";
I'd suggest you rather use the CGI module if you want to parse this
kind of free form variables.

Note You need to log in before you can comment on or make changes to this bug.