Sponsored Content
Top Forums Shell Programming and Scripting Perl CGI. no output until backend script is done Post 302444855 by pludi on Friday 13th of August 2010 03:24:04 AM
Old 08-13-2010
Perl buffers output on stdout by default untill the buffer is full, or a newline is found. You can force output either by adding ',"\n"' to the end of your print statements, or by disabling output buffering by adding this line near the top:
Code:
$| = 1;

But even then it's not guaranteed that the browser will start rendering the page before it received all the content.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

2. Web Development

in cgi perl script a form

hi,i hav a form in cgi perl script.this script accepts a value from user from another html form, and depending upon this value,i need to disable /enable radio buttons in cgi-perl script wen second page is displayed on executing cgi perl script.how do i do it using javascript? (0 Replies)
Discussion started by: raksha.s
0 Replies

3. Web Development

perl cgi script not working

Hello, Met a problem learning perl cgi script. 1 #!/usr/bin/perl -wT 2 3 use strict; 4 use CGI qw(:standard); 5 6 my $q = new CGI; 7 8 my $filename = $q->param('/home/yifangt/hello.cgi'); 9 my $contenttype = $q->uploadInfo($filename)->{'Content-Type'}; 10... (5 Replies)
Discussion started by: yifangt
5 Replies

4. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

5. UNIX and Linux Applications

phonon-backend-gstreamer vs phonon-backend-vlc vs phonon-backend-xine

phonon-backend-gstreamer vs phonon-backend-vlc vs phonon-backend-xine What are the advantages and disadvantages of phonon-backend-gstreamer, phonon-backend-vlc, and phonon-backend-xine. I was reading this and got curious. ... (1 Reply)
Discussion started by: cokedude
1 Replies

6. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

7. Shell Programming and Scripting

Perl : embedding java script with cgi perl script

Hi All, I am aware that html tags can be embedded in cgi script as below.. In the same way is it possible to embed the below javascript in perl cgi script ?? print("<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">"); print("<input type = "text"... (1 Reply)
Discussion started by: scriptscript
1 Replies

8. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

9. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

10. Shell Programming and Scripting

Not able to copy the file in perl cgi script

Hello experts, I am facing an very typical problem and hope the issue can be solved. I have a page download.cgi in /cgi-bin folder. use CGI; use CGI::Carp qw ( fatalsToBrowser ); use File::Copy copy("C:\\Program Files\\Apache Software... (8 Replies)
Discussion started by: scriptscript
8 Replies
setbuf(3S)																setbuf(3S)

NAME
setbuf(), setvbuf(), setlinebuf() - assign buffering to a stream file SYNOPSIS
Obsolescent Interface DESCRIPTION
can be used after a stream has been opened but before it is read or written. It causes the array pointed to by buf to be used instead of an automatically allocated buffer. If buf is the NULL pointer input/output will be completely unbuffered. A constant defined in the header file, tells how big an array is needed: can be used after a stream has been opened but before it is read or written. type determines how stream is to be buffered. Legal values for type (defined in are: causes input/output to be fully buffered. causes output to be line buffered; the buffer will be flushed when a newline is written, the buffer is full, or input is requested. causes input/output to be completely unbuffered. When an output stream is unbuffered, information is queued for writing on the destination file or terminal as soon as written; when it is buffered, many characters are saved up and written as a block. When the output stream is line-buffered, each line of output is queued for writing on the destination terminal as soon as the line is completed (that is, as soon as a new-line character is written or terminal input is requested). can also be used to explicitly write the buffer. If buf is not the NULL pointer, the array it points to is used for buffering instead of an automatically allocated buffer (from size speci- fies the size of the buffer to be used. The constant in is suggested as a good buffer size. If input/output is unbuffered, buf and size are ignored. By default, output to a terminal is line buffered and all other input/output is fully buffered. is used to change stream from block-buffered or unbuffered to line-buffered. can be used any time the file descriptor is active. Obsolescent Interface assigns buffering to a stream file. DIAGNOSTICS
If an illegal value for type or size is provided, return a non-zero value. Otherwise, the value returned will be zero. Note A common source of error is allocating buffer space as an "automatic" variable in a code block, then failing to close the stream in the same block. Allocating a buffer of size or bytes does not necessarily imply that all of size or bytes are used for the buffer area. AUTHOR
and were developed by HP. SEE ALSO
flockfile(3S), fopen(3S), getc(3S), malloc(3C), putc(3S), stdio(3S), thread_safety(5), glossary(9). STANDARDS CONFORMANCE
setbuf(3S)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy