Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Re: Problems capturing STDERROR

Expand Messages
  • Jason Waugh
    ... None of this still works. You see, ^$GetOutput()$ gives no problem when trying to get the output of a Perl script. *THAT* I can do fine... absolutely no
    Message 1 of 31 , Apr 3, 2001
    • 0 Attachment
      On 4/3/2001 at 7:26 AM wheeler54321@... wrote:

      >You see - I have all these problems without the quotes around "^**".
      >I think ^$GetOutput$/^$GetDosOutput work best (if not ONLY) with ^!
      >TextToFile or ^!Info or the output will get placed in the ^** doc.

      None of this still works. You see, ^$GetOutput()$ gives no problem when trying to get the output of a Perl script. *THAT* I can do fine... absolutely no problem...

      ^!Prompt ^$GetOutput("perl ^**")$ works everytime.

      It is only when trying to catch the output of a Perl syntax check ("perl -c ^**") that the problem occurs. Syntax Check does not output to StdOut - it outputs to StdErr. Since there is no ^$GetStdErr()$ function, I have to resort to running the command line and then opening StdError.Err to see what happened.

      Most of the time, StdError.Err doesn't even get created, so when it comes time to open it (in ANY way, whether OPEN or ^!Info or whatever) there is nothing to open.

      The rest of the time, I get, in StdError.Err the message - Can't open perl script "E:\perlstuff\address2.pl": Invalid argument. You are talking about the quotes here. They don't matter. Try at a command line 'perl -c perlscript' or 'perl -c "perlscript"' you will find you get the same result. Perl handles it both ways.

      I've tried this SO many ways, that I am convinced that there is just a bug somewhere in this.
    • Phillip S. Buckland, Jr.
      ... Thanks for the memory jog! I experienced the buffering problem when porting PERL scripts from Unix to MS-DOS several years ago (Perl 4, so the details have
      Message 31 of 31 , Apr 5, 2001
      • 0 Attachment
        At 10:20 PM 4/4/01, Jason Waugh wrote:
        > >I don't know the intricacies of using ^** you might have a point about it's
        > >'inconsistency' You would think it would work the same as ^$GetDocName$.
        > >Actually I never bother using "^**" and always use ^$GetDocName$
        > >instead.
        >
        >Well, it's not so much an inconsistency with ^** as it is an inconsistency
        >in the way NoteTab and Perl are working together with respect to
        >STDERR. Maybe Perl isn't flushing before NoteTab thinks it's done
        >capturing STDERR? Maybe the NoteTab parser occasionally chokes on parsing
        >^**? This would result in the two different error messages appearing on
        >different tries with the same script....

        Thanks for the memory jog!

        I experienced the buffering problem when porting PERL scripts from Unix to
        MS-DOS several years ago (Perl 4, so the details have changed about
        avoiding the problem since I wrote those scripts). I recall needing to
        either disable buffering, or set it to line buffering (from block
        buffering) to make the problem go away.

        Find a Perl reference (here's one I have: "Programming Perl", second
        edition, by Larry Wall, Tom Christiansen & Randal L. Schwartz, published by
        O'Reilly, copyright 1996) and look for information on the "$|"
        variable. It allows you to set output filehandles to block buffering
        (default) or line buffering (which is needed for Perl with NoteTab, since
        it runs as a DOS program).

        Hope this is helpful.
      Your message has been successfully submitted and would be delivered to recipients shortly.