Title: RE: problem running cli program from perl cgi script..

I'd suggest using single quotes around the $get_events string or if you need variable interpolation of "machine1" then change the system call to something like:

        @args = ("get_events.exe","--sensor machine1","--save event.txt");
        system(@args) == 0 or die "system @args failed: $?";

Just off the top of my head. I did not debug your code. The above code is much more reliable when executing system commands. You might also have to fully qualify the path to "get_events.exe" if it is not in the system path.

Trevor J. Joerges
http://members.home.net/tjoerges
________________________________
$_=q;KvtuyboopuifeyQQfeemyibdlfee;;
y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;;
________________________________



-----Original Message-----
From: Schiza, Apostolia (ISS Atlanta) [mailto:[EMAIL PROTECTED]]
Sent: January 2, 2001 11:52 AM
To: 'Ron Grabowski'; perl-win32-web@listserv. ActiveState. com (E-mail)
Subject: RE: problem running cli program from perl cgi script..


Ok this is the code... it's only couple of lines calling the command line
program...

#!/usr/bin/perl -w

        my $get_events = "get_events.exe --sensor machine1 --save
event.txt";
        system($get_events);
print "This is the system result $?";


When I run the script from command line the value I get from the system call
is 0, which means that get_events executed fine.
Nothing happens though when I run the script through cgi... it just hungs
there... on the task manager i see get_events.exe running...

Thanks again!

-Lia-
-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 02, 2001 11:08 AM
To: perl-win32-web@listserv. ActiveState. com (E-mail)
Subject: Re: problem running cli program from perl cgi script..


> Any ideas why this is happening? Is it a permission problem?

Its hard to tell without some source code. What does $! say? Are you
checking the return status of the system call?

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to