Re: How to call another program

From: Joe Smith (Joe.Smith_at_inwap.com)
Date: 05/04/04


Date: Tue, 04 May 2004 08:50:00 GMT

Alan J. Flavell wrote:

> On Mon, 3 May 2004, Joe Smith wrote:
>
>
>>You could have part-1.pl output HTML that runs two CGIs in parallel.
>>
>> <frameset rows="100%,*">
>> <frame src="/cgi-bin/part-2.pl">
>> <frame src="http://www.domain.com/cgi-bin/copyprog.pl">
>> </frameset>
>> <noframes>
>> <body><img src="/cgi-bin/part-2.pl" width=1 height=1">
>> <img src="http://www.domain.com/cgi-bin/copyprog.pl" width=1 height=1>
>> </body>
>> </noframes>
>
>
> Was that wise? While it seems to have got the questioner off our
> backs, I'd have to say that if it were to be presented as a solution
> in a WWW group (which is where I suspect it would be more on-topic,
> since there's almost no specifically Perl-language relevance here), it
> would likely have been shot down in flames.

I did give it some thought, and decided that the expedient solution
would be worth it, if only to reduce flamage and allow other threads
of discussion to prosper.

> There's just too many imponderables being left to the client side
> (who'd be perfectly entitled to disable frames and/or images if they
> felt like it) for this to rate as a robust piece of web engineering,
> I'm afraid.

No frames: taken care of. Both no frames and no images: only the OP
would know if that would be a concern for his expected audience.
As for robustness, I expect the OP will eventually realize that he
had 95% of the solution with the script that use LWP twice.

I would have done it this way:

1) Output the HTTP and HTML headers immediately, to give the user
    feedback. This would include sending <BR>, <HR>, <P></P>, or other
    HTML tag that forces a line break, so that the browser will
    render the partial page. (No <table> at this stage.)

2) Execute an LWP request inside the CGI, with a suitable timeout
    being set. When the results come back, output more HTML, with
    another line break.

3) Do post-processing. This could be fork()+exec(), system("... &"),
    or just let the browser sit and wait for processing to complete.
    [I've seen one CGI output <HR width="10%">(pause)<HR width="20%">,
    etc as a pseudo progress bar.]

        -Joe



Relevant Pages

  • Re: Interframe communication
    ... the rest of your "frames" can be made part of the page itself. ... `div' *is* a proper standardized HTML element type since HTML 4.01. ... we all know how well supported:hover is on images in the most predominant browser on the web. ...
    (comp.lang.javascript)
  • Can a web control appear to cross a frames border?
    ... A banking web app I've been using lately ... I say 'appears to be using frames' because ... there are no html definitions for the other ... which opens a browser window with no tool, menu or address bars (I have ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Aw shoot
    ... All are 'strict' HTML and CSS which ... It all looks fine at my end on any browser. ... Replace frames with server side includes so that your documents do ... When I look at http://www.jimscott.co.uk/ I see a frameset. ...
    (alt.html)
  • Re: New Website Detailing History of A Non-Profit
    ... most search engines use crawlers or bots to locate ... indexing data from Web pages that are not valid HTML. ... You are using frames for no really good purpose. ... Your copyright notice appears on my browser window as ...
    (soc.org.nonprofit)
  • Re: Simple question ??
    ... A web page is basically an HTML document. ... a technology that, at the most basic level, delivers HTML to a web browser. ... Internet Explorer, for example, can display Word documents, ... file format to a browser in its native state. ...
    (microsoft.public.dotnet.framework.aspnet)