I want to call a perl script from inside another perl script, but everytime I run it, a cmd window pops up, even if I close all the I/O handles. Is there any way to avoid the cmd window to popup in perl? I want to avoid annoying windows to be more user friendly.

I'm using Windows XP.

Any ideas are appreciated...

post some code....

I want to call a perl script from inside another perl script, but everytime I run it, a cmd window pops up, even if I close all the I/O handles. Is there any way to avoid the cmd window to popup in perl? I want to avoid annoying windows to be more user friendly.

I'm using Windows XP.

Any ideas are appreciated...

I also have this problem and can't find the solution anywhere. I had this problem previously when launching VB scripts, and it was solved by running the command "cscript //h:wscript" in a cmd window once. I haven't found a way to do something similiar with Perl. It seems so far, that the supposed "language independent" windows scripting host works well only with scripting languages invented by Microsoft :-(
I hope I am wrong and that someone could correct me.

If you do find the solution, please share as I'm sure many others have the same issue.

try using wperl.exe instead of the regular perl.exe

I want to call a perl script from inside another perl script, but everytime I run it, a cmd window pops up, even if I close all the I/O handles. Is there any way to avoid the cmd window to popup in perl? I want to avoid annoying windows to be more user friendly.

I'm using Windows XP.

Any ideas are appreciated...

How are you calling a perl script from inside another perl script?
If you are using system() to call another perl script, then you are likely to get another window(as explained by you).

If you are doing the same thing same as my guess, you can try this,

open(F, 'prog.pl');           # assume this is a perl script
while(<F>){
	$str .= $_;             # read complete script into one scalar
}

eval($str);                     # execute your script
# you can even get access to the results

I dont know how far this solution is good. But you can try...

Hope this helps.

katharnakh.

may as well use "do" instead of eval.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.