Dan Wilga wrote: > What surprises me is that all I have to do to introduce the problem is > run it under mod_perl. It acts normally when run from the commandline.
Well, let's see, what would be different... Is it possible that the problem is concurrency from multiple mod_perl processes? What happens when you run it with httpd -X ? Could there be a permissions issue involved? Are you sure you're only invoking the script once under mod_perl? If you raise the number of repetitions, does the command-line version exhibit the problem? I don't see any scoping issues in your script, but are you running it under Apache::Registry? Maybe the nested subroutines that creates are causing problems. - Perrin