I have traced my problem to the following
subroutine which populates the Hash I use to keep track of mappings of URL's to
Modules (handlers) to use.
As you will see, at the very end of my parse_file
subroutine I have two lines commented out. IF I uncomment these lines out, I end
up overwriting the data in my hash with the clean data I supply. When I do this
my Apache Multiplexer (the thing which does the
$r->push_handlers($handler_bf)) works fine and all is fine. However if I
leave the line commented out - as is here - I get the following
error:-
[Tue Sep 17 22:41:35 2002] [error] Undefined
subroutine &MyMod::Apache::Test1 called, <GEN2> line 2.
So I'm at a loss, any further help you could give
would be useful,
Marty
Here is a sample file:-
/test1/ =
MyMod::Apache::Test1
/test2/ = MyMod::Apache::Test2 Here is a file parsing subroutine I use to read the
above file and populate a hash, which I export to another
routine.:-
our (%HANDLERS);
sub _is_tainted
{ not eval { join("",@_), kill 0; 1; }; } sub parse_file
{ my $file=shift; print STDERR "Parsing file $file\n"; open (FILE,"<$file") or die "Cannot open file for reading $file"; while (my $line=<FILE>) { chomp $line; if ($line=~/^\#/) { next; } else { my ($keyname,$varname)=split/\=/,$line; print STDERR "Initial $keyname = $varname\n"; $keyname=~s/^\s*//; $varname=~s/^\s*//; $keyname=~s/\s*$//; $varname=~s/\s*$//; $keyname=~s/'//g; $varname=~s/'//g; $keyname=~s/"//g; $varname=~s/"//g;
$keyname=~s/^\///;
$keyname=~s/\/$//; my @tmp=split /\//, $keyname; my $untainted_keyname; while (@tmp) { my $tainted_var=shift @tmp; if ($tainted_var =~/^([\w-]+)$/) { $tainted_var=$1; die "$tainted_var is Tainted" if (&_is_tainted($tainted_var)); $untainted_keyname.='/'.$tainted_var; die "$untainted_keyname is Tainted" if (&_is_tainted($untainted_keyname)); } else { die "Taint Check failed for $tainted_var\n"; } } $untainted_keyname.='/'; if ($varname=~/^([-:\w]+)$/) { $varname=$1; die "$varname is Tainted" if (&_is_tainted($varname)); } else { die "Taint Check failed for $varname\n"; } $HANDLERS{$untainted_keyname}=$varname; print STDERR "Added $keyname = $varname\n"; } } #$HANDLERS{'/test1/'}='MyMod::Apache::Test1'; #$HANDLERS{'/test2/'} = 'MyMod::Apache::Test2'; close (FILE); }
|
- Re: problem with $r->push_handlers() Geoffrey Young
- Re: problem with $r->push_handlers() Martin Moss
- Re: problem with $r->push_handlers() Marcin Kasperski
- Re: problem with $r->push_handlers() Martin Moss
- [OT] document management Erich Markert
- Re: [OT] document management iudicium ferat
- Re: [OT] document management Valerio_Valdez Paolini
- Re: [OT] document management Enrico Sorcinelli
- Re: [OT] document management Ken Y. Clark