Sponsored Content
Full Discussion: Perl CGI Scripting
Top Forums Shell Programming and Scripting Perl CGI Scripting Post 302719697 by liyakathali on Tuesday 23rd of October 2012 12:40:08 AM
Old 10-23-2012
Perl CGI Scripting

Hi,

My below cgi script works fine from the command line but not working from the web browser.
Code:
#!/usr/bin/perl
use File::Copy;
use CGI;
print "Content-type: text/html\n\n";
print "<html><head><title>LOGS";
print "</title></head>";
print "<body bgcolor=#95B9C7 link=black>";

$infile="/home/jaindin/jaindin_PerlCGI/IN/data_1.xml";
$jobxml="/home/jaindin/jaindin_PerlCGI/IN/data_2.xml";
print "copy $infile $jobxml\n";
copy($infile,$jobxml);         #copy data.xml to jobdata.xml
print "</body></html>\n";

when I run the above program from the command line like ./copy.cgi copy command is working but when I execute it from the URL copy command is not working.Please help.

Last edited by Franklin52; 10-23-2012 at 04:48 AM.. Reason: Please use code tags for data and code samples
 

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
AppConfig::CGI(3)					User Contributed Perl Documentation					 AppConfig::CGI(3)

NAME
AppConfig::CGI - Perl5 module for processing CGI script parameters. SYNOPSIS
use AppConfig::CGI; my $state = AppConfig::State->new(\%cfg); my $cgi = AppConfig::CGI->new($state); $cgi->parse($cgi_query); $cgi->parse(); # looks for CGI query in environment OVERVIEW
AppConfig::CGI is a Perl5 module which implements a CGI interface to AppConfig. It examines the QUERY_STRING environment variable, or a string passed explicitly by parameter, which represents the additional parameters passed to a CGI query. This is then used to update variable values in an AppConfig::State object accordingly. AppConfig::CGI is distributed as part of the AppConfig bundle. DESCRIPTION
USING THE AppConfig::CGI MODULE To import and use the AppConfig::CGI module the following line should appear in your Perl script: use AppConfig::CGI; AppConfig::CGI is used automatically if you use the AppConfig module and create an AppConfig::CGI object through the cgi() method. AppConfig::CGI is implemented using object-oriented methods. A new AppConfig::CGI object is created and initialised using the new() method. This returns a reference to a new AppConfig::CGI object. A reference to an AppConfig::State object should be passed in as the first parameter: my $state = AppConfig::State->new(); my $cgi = AppConfig::CGI->new($state); This will create and return a reference to a new AppConfig::CGI object. PARSING CGI QUERIES The "parse()" method is used to parse a CGI query which can be specified explicitly, or is automatically extracted from the "QUERY_STRING" CGI environment variable. This currently limits the module to only supporting the GET method. See AppConfig for information about using the AppConfig::CGI module via the cgi() method. AUTHOR
Andy Wardley, "<abw@wardley.org<gt"> COPYRIGHT
Copyright (C) 1997-2007 Andy Wardley. All Rights Reserved. Copyright (C) 1997,1998 Canon Research Centre Europe Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
AppConfig, AppConfig::State perl v5.16.3 2007-05-30 AppConfig::CGI(3)
All times are GMT -4. The time now is 11:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy