perl - CGI-ExtDirect-2.02 can't call method "result" on an undefined value -
i working on converting interface of perl web application ext
, intended use cgi-extdirect-2.02
library.
i encountered problem though, which, after many hours of struggling, still remains unresolved.
in simplest use case problem is: when adding following lines action method, example, demo/testaction/getgrid
, error occurs in router.pm
. same error appears both when executed under apache
or using included library p5httpd.pl
server.
when remove while(<file>)
loop, error goes away , else works fine.
system configuration is:
sunos 5.10, apache 2, perl 5.12.1.
lines add:
open(file, "</tmp/test.txt") or die("can't open file: $!"); while (<file>) { ; } close(file);
error:
5571 17:58:08 server started on port 5000. 5571 17:58:08 5571 17:58:08 point browser @ http://localhost:5000 5571 17:58:11 <- localhost: /direct-grid.html http/1.1 5571 17:58:11 -> 200 ok /direct-grid.html: 803 bytes sent text/html 5571 17:58:11 <- localhost: /example.css http/1.1 5571 17:58:11 -> 200 ok /example.css: 1501 bytes sent text/css 5571 17:58:11 <- localhost: /direct-grid.js http/1.1 5571 17:58:11 -> 200 ok /direct-grid.js: 1599 bytes sent application/x-javascript 5571 17:58:11 <- localhost: /cgi-bin/api.cgi http/1.1 5571 17:58:11 -> exec'ing api.cgi 5571 17:58:13 <- localhost: post /cgi-bin/router.cgi http/1.1 5571 17:58:13 <- content-length: 119, type: application/json; charset=utf-8 5571 17:58:13 -> exec'ing router.cgi can't call method "result" on undefined value @ /usr/perl5/site_perl/5.12.1/rpc/extdirect/router.pm line 136. 5571 17:58:13 -> 500 internal server error premature end of script headers. <br> status: 65280<br>have @ server log stderr output of /cgi-bin/router.cgi
if loop has nothing problem, there problem file
superglobal conflicting something. try changing like
open $if, "<", "/tmp/test.txt"; while(<$if>) { # whatever } close $if;
Comments
Post a Comment