Hello everyone,
Well over the past day I have been trying to debug this problem yet can't
figure out a solution.
Here is the problem, I am using the SSI program from the eagle book on page
94-104.
Now that works fine but I have a function that is in the include file which
needs to read in a config file and place its contents inside a hash. Now
the problem:
I open the file needed for reading and then inside the loop whenever the
first match occurs the loop is for some reason the loop stops??? Now I know
the code works perfectly since I have run it from a normal script and it
does exactly what it is supposed to but yet under modperl for some reason
it stops after the first successful match...
Code in question is this
unless ($fh = Apache::File->new($file)){
print STDERR "Couldn't open $file because: $!\n";
return undef;
}
while( <$fh> ){
next if /^#/; # Skip comments
next if /^$/; # Skip blank lines
m/(\d+):([0-9,]*):(.*)/;
$id = $1;
$temp = $2;
$name = $3;
$CAT{$id}{"name"} = $name;
}
close $fh;
Now I have tried many variations on this, using open, placing all the file
inside an array yet it still exists on the first match is made and doesn't
keep processing the file....
If you remove all the pattern matching statements the entire file is
processed like it should be.
System is a stock Redhat 6.1 machine running apache 1.3.11 and modperl 1.21
Any ideas?
Steve