in reply to Perl SYSCALL

That's just a normal call to open that tries to open a pipe.

In what way does it not work? You should emit error messages like this:

open SYSCALL, "$hlcmd |" or die "Can't start '$hlcmd': $!";

That way you have a chance to find out what's wrong when it doesn't work.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Perl SYSCALL
by FloydATC (Deacon) on Oct 27, 2009 at 05:41 UTC
    It might be worth pointing out that the error message will appear in the web server error log and not in the browser, unless there's some magic in place.

    -- Time flies when you don't know what you're doing
Re^2: Perl SYSCALL
by tim.mcintosh (Initiate) on Oct 27, 2009 at 14:43 UTC
    Gentlemen, and Ladies,

    I am running Perl 5.8.3 that is the Windows Perl embedded with Oracle 10g DBMS during the Oracle installion. Admittely, I am dangerous with Perl as it was so painfully pointed out, but, I need to fix the problem.

    Based on replies I changed the code as follows to trap an error.

    $hldcmd = "$pathcc\\$hldbat > $pathcc\\$txtname.txt";
    open SYSCALL, "$hldcmd |" or die "Requested submit failed -> $hlcmd: $!";

    I received the following error message on the browser->

    Software Error:
    Requested submit failed -> , Bad file descriptor at C:\Inetpub\pmmproot\cgi-bin\viewbat.pl line 255 (this is the SYSCALL line above).
    For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
    Tue Oct 27 09:39:29 2009 viewbat.pl: Requested submit failed -> , Bad file descriptor at C:\Inetpub\pmmproot\cgi-bin\viewbat.pl line 255.

    I checked the paths/names and they look good. The variables translate to the following values:

    pathcc - C:\inetpub\pmmproot\pmmpcc
    hldbat - B1MSN10232009104615.BAT
    txtname - B1MSN10232009104615
    submit - C:\inetpub\pmmproot\pmmpcc\B1MSN10232009104615.BAT > C:\inetpub\pmmproot\pmmpcc\B1MSN10232009104615.txt

    I took the value in submit and ran it in DOS and it worked. So I am more confused.

    I certainly appreciate you taking the time but I am not sure what to look at next.

    Thanks Tim

      Try using the system() builtin function. As you are redirecting the output of the batchfile to a file, there is no point in opening a pipe from that batch to your script.

      If it doesn't help try to execute "$ENV{ComSpec} $pathcc\\$hldbat > $pathcc\\$txtname.txt".

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.