in reply to shelling out too much

What do you mean "slows down your script"? If you are running it thru system or backticks, your script will have to wait for it to complete, before continuing. If "myscript" involves a long process, then you just have to wait. It wouldn't be any faster if you put the guts of "myscript" into a subroutine into your original script. You will still have to wait for that subroutine to do it's work and return. The amount of time it takes for Perl to compile the script is neglible, unless you are repeatedly calling it 100's of times.

So what are your options? If you don't need "return values" from "myscript" (like if it is mailling something), you can do a "fork-and-exec" to run it, which will let your main program continue running at full speed.

The tricky part, is if you need return values. In that case, there is IPC, POE and GUI's which use event loops like Tk, Gtk2, Wx , etc. You can also setup some pipes and pipe your data back from a fork and exec.

Since you claim your problem is the -h option, preventing a require, why not make a copy of "myscript" and call it myscript1, and just hardwire the -h option into it, and require it? I have a feeling that it won't fix your problem, because it involves a time consuming process.


I'm not really a human, but I play one on earth. flash japh