3
1
A little background:
I am trying to interact with data I have saved in Perl files using a program I wrote in C using the Win32 API. The C program is in Windows and the Perl files are accessed through a mapped network drive in a Unix environment. I am using perlembed and am successfully pulling the data I want from the Perl files using the embedded Perl interpreter & Perl subroutines called from C.
The problem:
I have to run Perl scripts that are already in place on the Unix side. The function of these scripts is to check the syntax of the Perl files and check them into a revision control system that I am using. The scripts call some Unix specific commands like pwd
that cause the C program to break when I use system(perl perl_file)
. There is quite a bit of legacy Perl code so I don't think I can modify any of the Perl check scripts that need to be called.
My question:
How am I able to execute a Perl script in a Unix environment from the C program on the Windows side? I came across this question suggesting the use of cygwin but that seems to be just another environment in between Unix and Windows. I thought that there might be some way into allowing the C program to use a C shell in the mapped network drive to run the Perl script but I didn't find any examples of this anywhere. Or maybe I could have the Perl interpreter in the Unix environment run the program (using the shebang line)? I hope this isn't a dumb question. I just did so much work to be able to manipulate the Unix Perl data from the Windows side & it is frustrating to not be able to complete my task because I can't run a Perl script.
Thanks!
1I'm not a networking expert, but mapping a network drive does not expose all of the remote system's functionality to your local system. Connection via a different protocol (such as SSH) is required to run shell commands. – Daniel Standage – 2013-04-26T03:38:14.260
This isn't specifically a programming question (and @DanielStandage is correct). You want the superuser or serverfault websites. I suggest learning a little about system administration and networking before proceeding with this task. – None – 2013-04-26T04:19:31.693