Random_Walk has asked for the wisdom of the Perl Monks concerning the following question:
Friends of the path of Perl, I am trying to return JSON to javascript in Chrome from an IIS server using Activestate's PLX Perl. For those not familiar, Activestate plx is Perl as a DLL, so IIS can load it once and use it many.
I can get JSON return to work with a simple Perl CGI script
use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); use JSON; my $c=CGI->new(); print $c->header('application/json'); my $json = JSON->new->relaxed->pretty; my $data = { this => 'test', is => 'simple'}; print $json->encode( $data );
That works fine as .pl using perl.exe. However when I change the extension to .plx, which IIS is configured to run with the perlis.dll, it still runs, but its return is seen as a string in the browser, not a JSON object. If I leave in the print headers, I get the content type in the string, if I remove it (ISAPI is not CGI) I still just get a string with the Json data.
Is anyone out there familiar with this 'technology' and able to give some guidance.
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can not get JSON back from ActiveState plx ISAPI Perl, JSON and IIS
by Discipulus (Canon) on Feb 07, 2014 at 09:21 UTC | |
by Random_Walk (Prior) on Feb 07, 2014 at 09:42 UTC | |
by Anonymous Monk on Feb 07, 2014 at 09:44 UTC | |
|
Re: ActiveState plx ISAPI Perl, JSON and IIS (PerlEx)
by Anonymous Monk on Feb 07, 2014 at 09:08 UTC |