Re: How to call another program
From: Joe Smith (Joe.Smith_at_inwap.com)
Date: 05/04/04
- Next message: Heinrich Mislik: "Re: Q on "use""
- Previous message: Mark Clements: "Re: complile a program with 2 files"
- In reply to: Alan J. Flavell: "Re: How to call another program"
- Next in thread: Alan J. Flavell: "Re: How to call another program"
- Reply: Alan J. Flavell: "Re: How to call another program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Heinrich Mislik: "Re: Q on "use""
- Previous message: Mark Clements: "Re: complile a program with 2 files"
- In reply to: Alan J. Flavell: "Re: How to call another program"
- Next in thread: Alan J. Flavell: "Re: How to call another program"
- Reply: Alan J. Flavell: "Re: How to call another program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|