CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Problem callin exe from Perl script

 



nmolino
New User

Jan 7, 2012, 1:03 PM

Post #1 of 2 (472 views)
Problem callin exe from Perl script Can't Post

In my Perl script, I create a file:
open(MyFileID,">MyFile.out");

I write to the file, and then I close it:
close(MyFileID);

I then run an executable I created:
system("$MyExecPath");
(I designed the executable to know exactly where MyFile.out is.)

However, the executable can't access MyFile.out when called this way. I have even made sure that the executable is looking in the right place, and it is.

If I run the executable independently without the Perl script running, it finds and accesses MyFile.out no problem.

Any ideas why this is happening and how I can get this to work while the Perl script is running??

Thanks,
Nick

PS. I'm running Perl version 5.12.4


rovf
Veteran

Jan 9, 2012, 1:16 AM

Post #2 of 2 (442 views)
Re: [nmolino] Problem callin exe from Perl script [In reply to] Can't Post

(1) Please print($MyExecPath) before running system

(2) If you are on Unix, also do a system("ls -l $MyExecPath")

(3) How did you verify, that $MyExecPath couldn't be accessed? Did you check the return code of system(...)?

(4) Do you have strict and warnings enabled?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives