I looked at system and exec in my book, but it doesnt give a clear way to execute the second perl script.
Could it be: system(BlastTool(#params here)); (will look into that though, thanks).
Also if i use system, as i understand it here, it creates a fork and waits for the son process to finish. Could i therefore implement a loading page also at this stage, and display a "waiting gif" or something whilst it waits for the son process to complete (- spiraling off with more and more ideas).
Cheers, MonkPaul | [reply] |
You're right about system() waiting for a child process to complete, but exec() works differently. It basically calls the program that you specify and kills the script that's currently running (unless the command can't run, in which case it will return false and put something interesting in $!). Generally I'd use exec() after forking, and use system() when you expect your external command to return in a timely fashion (In fact, system forks then execs and waits for the child to return before giving control back to the script). If you want to display an animated 'waiting' gif or something like it, system() would probably be the one you want.
In either case, you should enclose your command in quotes or generate an array with your command as the first element and it's arguments as the remaining elements:
system("/path/to/BlastTool my params here") or die "Could not run command";
or:
@command = ("command", "my", "params", "here");
system(@command) or die;
| [reply] [d/l] [select] |