ashwani has asked for the wisdom of the Perl Monks concerning the following question:

hi friends, i made executable of perl application using PDK say helloworld.exe. made from Helloworld.pl
the code in my script was
#!/usr/bin/perl print "Content-type:text/html\n\n"; print "<HTML><HEAD>"; print "<TITLE>HelloWorld</TITLE></HEAD>"; print "<BODY BGColor=fffff><TABLE Width='100%'><TR><TD><H2>Hello World +..!</H2></TR></TD></TABLE>"; print "</BODY></HTML>";


i made exe of this perl script using PDK and run it at my test site then it is giving out put on browser
"Hello World..!"
but when i use this code
#!/usr/bin/perl print "Content-type:text/html\n\n"; print <<HTML_END; <HTML><HEAD> <TITLE>HelloWorld</TITLE></HEAD> <BODY BGColor=fffff><TABLE Width='100%'><TR><TD><H2>Hello World..!</H2 +></TR></TD></TABLE> </BODY></HTML> HTML_END

now this time it is not shwoing that out put.

well, for your information
in both case i'm running this exe on my test site where perl is not installed and i'm running this exe via php script.

platform is WindowsXP
server IIS 6.0
now i'm very confused why is it so. one time getting output and second time not.
let me know if need more detail.
Thanks
Ashwani

Replies are listed 'Best First'.
Re: perl application's executable not shwoing result!
by ikegami (Patriarch) on Aug 08, 2006 at 07:12 UTC

    now this time it is not shwoing that out put.

    It would be more useful to know what it *did* show. What error did you get (in your error log)?

    While not relevant to your question, BGColor=fffff is wrong. Colour codes are six (not five) hexadecial digits long, and they must start with a pound sign (#). Also, because of the pound sign, quotes are required. Finally, it's not smart to specify a foreground colour without specifying the background colour.

    Also not relevant to your question, </TR></TD> should be </TD></TR> (or just </TD> or just </TR> or omitted entirely, but not </TR></TD>).

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: perl application's executable not shwoing result!
by tweetiepooh (Hermit) on Aug 08, 2006 at 10:02 UTC
    Why not return plain text in both cases as a test instead of HTML? That way you can rule out any odd stuff in HTML and see if it's a perl/CGI issue.

    My really old copy of "CGI Programming" has examples on pgs 103-4 for this sort of thing and is seems it should work. Looks like an issue with the server or the compiling into an exe and the server. As already mentioned what's in the logs.

Re: perl application's executable not shwoing result!
by GrandFather (Saint) on Aug 08, 2006 at 07:27 UTC

    One difference is that the second version will include line end sequences that the first version doesn't have. Beyond that you will have to wait for someone wiser in the ways of CGI.


    DWIM is Perl's answer to Gödel
Re: perl application's executable not shwoing result!
by Cody Pendant (Prior) on Aug 08, 2006 at 07:43 UTC
    Is your "HTML END" on the last line really next to the left hand margin of the document? No spaces between the margin and the text? If there are spaces, that could explain it.


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
    A reply falls below the community's threshold of quality. You may see it by logging in.