Sponsored Content
Full Discussion: Perl CGI Scripting
Top Forums Shell Programming and Scripting Perl CGI Scripting Post 302720015 by DGPickett on Tuesday 23rd of October 2012 11:40:50 AM
Old 10-23-2012
Technically, isn't the http end of header '\r\n\r\n' ?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing CGI scripting using perl

Hi All, I am trying to do the following thing. I am entering name & email id & then in action i am calling a .cgi program that sends a email to the email id entered. I am facing a small problem, once i have entered the details , its printing the contents of .cgi file in browser. there is a... (7 Replies)
Discussion started by: alma
7 Replies

2. Shell Programming and Scripting

cgi scripting help needed

hi all, i'm new to CGI scripting. I want to compute memory utilisation, so when i run free command in my cgi scipt, if memory is utlised more than 70%. i want to display in free command in html as red color free total used free shared buffers ... (1 Reply)
Discussion started by: raghur77
1 Replies

3. Shell Programming and Scripting

CGI scripting Error

I am trying to execute following program #!/usr/bin/perl -wT use CGI qw(:standard); print start_html("Hello world"); and getting an error (offline mode: enter name=value pairs on standard input) i am a beginner so please try to explain it as much as possible. ---------- Post updated... (4 Replies)
Discussion started by: bhavesh.sapra
4 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. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies

6. 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

7. 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

8. Shell Programming and Scripting

CGI Perl : while loop in CGI perl

Hi Team, I am trying to connect to database(succeeded ) and print the records on the browser using while loop. But the elements of array are not displayed instead while loop is displayed directly. Instead of the below I can embed html statements in print but I am looking for the below style as I... (1 Reply)
Discussion started by: scriptscript
1 Replies

9. OS X (Apple)

Perl CGI

I am trying to get my MacBook Pro with 10.8 Mt Lion set up to run Perl CGI scripts. Having a problem. I can start Apache Web Server with no problems. Why do I put the static and dynamic scripts? I which directory? I have looked at this article:... (3 Replies)
Discussion started by: djehresmann
3 Replies
CGI::Fast(3pm)						User Contributed Perl Documentation					    CGI::Fast(3pm)

NAME
CGI::Fast - CGI Interface for Fast CGI SYNOPSIS
use CGI::Fast qw(:standard); $COUNTER = 0; while (new CGI::Fast) { print header; print start_html("Fast CGI Rocks"); print h1("Fast CGI Rocks"), "Invocation number ",b($COUNTER++), " PID ",b($$),".", hr; print end_html; } DESCRIPTION
CGI::Fast is a subclass of the CGI object created by CGI.pm. It is specialized to work well FCGI module, which greatly speeds up CGI scripts by turning them into persistently running server processes. Scripts that perform time-consuming initialization processes, such as loading large modules or opening persistent database connections, will see large performance improvements. OTHER PIECES OF THE PUZZLE
In order to use CGI::Fast you'll need the FCGI module. See http://www.cpan.org/ for details. WRITING FASTCGI PERL SCRIPTS
FastCGI scripts are persistent: one or more copies of the script are started up when the server initializes, and stay around until the server exits or they die a natural death. After performing whatever one-time initialization it needs, the script enters a loop waiting for incoming connections, processing the request, and waiting some more. A typical FastCGI script will look like this: #!/usr/bin/perl use CGI::Fast; &do_some_initialization(); while ($q = new CGI::Fast) { &process_request($q); } Each time there's a new request, CGI::Fast returns a CGI object to your loop. The rest of the time your script waits in the call to new(). When the server requests that your script be terminated, new() will return undef. You can of course exit earlier if you choose. A new version of the script will be respawned to take its place (this may be necessary in order to avoid Perl memory leaks in long-running scripts). CGI.pm's default CGI object mode also works. Just modify the loop this way: while (new CGI::Fast) { &process_request; } Calls to header(), start_form(), etc. will all operate on the current request. INSTALLING FASTCGI SCRIPTS
See the FastCGI developer's kit documentation for full details. On the Apache server, the following line must be added to srm.conf: AddType application/x-httpd-fcgi .fcgi FastCGI scripts must end in the extension .fcgi. For each script you install, you must add something like the following to srm.conf: FastCgiServer /usr/lib/cgi-bin/file_upload.fcgi -processes 2 This instructs Apache to launch two copies of file_upload.fcgi at startup time. USING FASTCGI SCRIPTS AS CGI SCRIPTS
Any script that works correctly as a FastCGI script will also work correctly when installed as a vanilla CGI script. However it will not see any performance benefit. EXTERNAL FASTCGI SERVER INVOCATION
FastCGI supports a TCP/IP transport mechanism which allows FastCGI scripts to run external to the webserver, perhaps on a remote machine. To configure the webserver to connect to an external FastCGI server, you would add the following to your srm.conf: FastCgiExternalServer /usr/lib/cgi-bin/file_upload.fcgi -host sputnik:8888 Two environment variables affect how the "CGI::Fast" object is created, allowing "CGI::Fast" to be used as an external FastCGI server. (See "FCGI" documentation for "FCGI::OpenSocket" for more information.) FCGI_SOCKET_PATH The address (TCP/IP) or path (UNIX Domain) of the socket the external FastCGI script to which bind an listen for incoming connections from the web server. FCGI_LISTEN_QUEUE Maximum length of the queue of pending connections. For example: #!/usr/bin/perl use CGI::Fast; &do_some_initialization(); $ENV{FCGI_SOCKET_PATH} = "sputnik:8888"; $ENV{FCGI_LISTEN_QUEUE} = 100; while ($q = new CGI::Fast) { &process_request($q); } CAVEATS
I haven't tested this very much. AUTHOR INFORMATION
Copyright 1996-1998, Lincoln D. Stein. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Address bug reports and comments to: lstein@cshl.org BUGS
This section intentionally left blank. SEE ALSO
CGI::Carp, CGI perl v5.14.2 2012-11-24 CGI::Fast(3pm)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy