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

I've tried what Dave suggested with no luck. I was able to print out everything up until the actuall image generation with no problems. I've also checked the Apache logs for an indication of the problem but see nothing. I'm at a loss on this one.

Replies are listed 'Best First'.
Re: Graphviz output straight to browser
by davido (Cardinal) on Oct 26, 2003 at 02:53 UTC
    Having just read the documentation for GraphViz.pm I don't see anything technically wrong with the portion of your code that deals with GraphViz.pm. There *is* one thing, but it's commented out: The documentation for GraphViz doesn't make any mention of _as_debug being a valid method. But as I mentioned, that's commented out, so I don't see that as the issue.

    However, the documentation does show a completely different way of outputting the image (besides print). Out of curiosity, what happens if you use one of the other output constructs recommended:

    $g->as_jpeg(\*STDOUT);
    ...immediately following your binmode call?

    As a last resort, comment out your "print "content-type: image/jpeg\n\n";", and instead, output a 'text/html' header at the top of the program. Then put a 'print "Just completed add_node('london'....";' after each GraphViz method call to see which call in particular is causing the "hang".

    Update: Ugh, how could I have missed seeing that the shebang line is wrong? I didn't even look at it. PodMaster++ for spotting it.


    Dave


    "If I had my life to live over again, I'd be a plumber." -- Albert Einstein
      Dave, Thanks for the information. I'll give it a try. By the way I do have #!d:\perl\bin\perl.exe as my first line. I missed the # when I copied and pasted the code.
Re: Graphviz output straight to browser
by PodMaster (Abbot) on Oct 26, 2003 at 03:03 UTC
    !d:\perl\bin\perl.exe
    That should be #!, so i'd like to reccomend you read
    Tutorials->Network/CGI Programming->CGI (and related) Programming->Troubleshooting and FAQ's->CGI Help Guide,
    as the snippet works for me ;)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      I messed up when I copied and pasted the code. My initial line does read as follows: #!d:\perl\bin\perl.exe
Re: Graphviz output straight to browser
by Anonymous Monk on Oct 27, 2003 at 00:26 UTC
Re: Graphviz output straight to browser
by Roger (Parson) on Oct 26, 2003 at 23:10 UTC
    Have you check your apache log? When this sort of thing happens, the first thing is to check the apache log. May be there is a problem with your server configuration.