[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Forum] Scope problem ? "my" variable %in masks earlier declaration in same scope.



Hi, I have a script where I get this problem,
I haven't changed anything all of a sudden the syntax check complains on this.
Does anyone have any ideas on why this occurs?
All help appreciated.
// Jimmy Lantz

# Extraction from error output:

# "my" variable $value masks earlier declaration in same scope.
File 'Server G4:WebSTAR Server Suite 4.2:cgi-bin:kursreg.cgi'; Line 283
# "my" variable $value masks earlier declaration in same scope.
File 'Server G4:WebSTAR Server Suite 4.2:cgi-bin:kursreg.cgi'; Line 284
# Can't use global $1 in "my".
File 'Server G4:WebSTAR Server Suite 4.2:cgi-bin:kursreg.cgi'; Line 284

####################### Takes form input to %in hash ###########################
sub read_form
{
read(STDIN,$in,$ENV{'CONTENT_LENGTH'} );
@in = split(/&/,$in); 
foreach $i (0 .. $#in) {
     $in[$i] =~ s/\+/ /g;
     ($key, $value) = split(/=/,$in[$i],2);

  $value=~tr/+/ /;
  $value =~ s/<!--(.|\n)*-->//g;
 $value=~s/%(..)/pack("c",hex($1))/ge;
if (! defined $in{$key})
{
$in{$key}  = $value; 
} 
else 
{
$in{$key}  = $in{$key} . '+' . $value; 
} 
  
} 
}

###############################

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-forum-request@macperl.org