-------- Original Message --------
Subject: Re: [Bug-apl] CGI script prints instead of executing when
FILE_IO is copied in
From: Juergen Sauermann <
address@hidden>
Date: Thu, September 24, 2015 3:36 am
To:
address@hidden,
address@hidden
Hi Alex,
on my machine the behavior is the same when FILE_IO is )COPYd or not )COPYed.
Looking at the script I would say that printing the page should be the expected behavior.
Maybe the )COPY of FILE_IO or HTML fails (and the error is hidden due to 0 0⍴⍎).
You could als try )SI instead of )OFF, )COPY instead of 0 0⍴⍎')COPY', and remove --script to see
more of what's happening.
A frequent difference between CGI-scripts run from the command line or from a web server is environment
variables, PWD, and the like. Since you use a relative path in )COPY 5 HTML the result may depend on
such things. To make things explicit always use absolute paths and full file extensions.
/// Jürgen
Hi Bug-APL,
It appears that this script works if FILE_IO is not copied in. When the FILE_IO is copied in, it appears that the cgi script runs but prints the HTML to the page. Is FILE_IO 's existence in the program make the script run under different conditions? (or is it possible there is something wrong in the non-APL part of the CGI interaction, in which case I'll troubleshoot elsewhere.)
#!/usr/local/bin/apl --script --
0 0 ⍴ ⍎')COPY /usr/local/lib/apl/wslib5/FILE_IO.apl'
0 0 ⍴ ⍎')COPY 5 HTML'
A←⎕arg
xTITLE←'You got here!'
xDESCRIPTION←'Congrats!'
yBODY←(,¨'{}') ⎕INP 'END-OF-⎕INP'
{A}
END-OF-⎕INP
HTML∆emit HTML∆Document
)off
-Alex