B
Brad Baxter
I am attempting to track down a "Too many open files"
situation in apache. This has led me to suspect some
of my Perl code, which is loaded by mod_rewrite from a
line like the following:
RewriteMap ggpd_do prg:/.../ggpd_do
.... and the script ggpd_do is then resident in memory
while apache is running.
Perl question: If a script like the following were loaded
as described above:
#!/usr/local/bin/perl -T
use warnings;
use strict;
$ENV{PATH} = '';
while( <STDIN> ) {
print get_file( $_ );
}
sub get_file {
my $file = shift;
chomp $file;
$file = $1 if /^(\w+)$/;
return '' unless $file;
my $ret = do "./$file";
return '' unless $ret;
return $ret;
}
.... when would "./$file" be closed? Right after 'do'? After
the script ends (which it wouldn't normally)?
Should I suspect code like this as a possible cause
for a "Too many open files" error?
Thanks,
situation in apache. This has led me to suspect some
of my Perl code, which is loaded by mod_rewrite from a
line like the following:
RewriteMap ggpd_do prg:/.../ggpd_do
.... and the script ggpd_do is then resident in memory
while apache is running.
Perl question: If a script like the following were loaded
as described above:
#!/usr/local/bin/perl -T
use warnings;
use strict;
$ENV{PATH} = '';
while( <STDIN> ) {
print get_file( $_ );
}
sub get_file {
my $file = shift;
chomp $file;
$file = $1 if /^(\w+)$/;
return '' unless $file;
my $ret = do "./$file";
return '' unless $ret;
return $ret;
}
.... when would "./$file" be closed? Right after 'do'? After
the script ends (which it wouldn't normally)?
Should I suspect code like this as a possible cause
for a "Too many open files" error?
Thanks,