0

Hi guys,

I would like to execute something like this in my program:
system("C:\test\perl\a.pl");

But the problem is i need to execute: perl a.pl
Can't just execute the a.pl and expect it to run. Any ideas on how i could simply open up the cmd prompt with my program and cd into the appropriate folder, and then enter: perl a.pl

Thanks for your help.

2
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by Grep
0

if the cmd runs it as: a.pl nothing happens
it needs to be ran as: perl a.pl

i just made a batch file. easy fix.

0

Right, I stuck a "perl" in front of the file name inside the system() call.

A batch file would also work (cd to the directory you want and then "perl file.pl"), but it doesn't seem necessary here.

Dave

0

Right, I stuck a "perl" in front of the file name inside the system() call.

A batch file would also work (cd to the directory you want and then "perl file.pl"), but it doesn't seem necessary here.

Dave

oops. missed your correction. thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.