473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

what is param() in CGI PERL

HI,

I have problem in this code

it is not working it is not going insdie param condition...

please what will be the problem

please help me

Expand|Select|Wrap|Line Numbers
  1. use CGI qw(:standard);
  2.  
  3. print "Content-type: text/plain\n\n";
  4.  
  5. if (param()) {
  6.     my $dest = param('dest');
  7.     my $opt  = param('opt');
  8.     my $file = param('file');
  9.     my $user = param('user');
  10.  
  11.     print "\n-->$dest  $opt  $file $user\n";
  12.     if ($file =~ /Z$/) {
  13.         `zcat $file | lp -d$dest -t $user $opt `;
  14.     } else {
  15.          `lp -d$dest -t $user $opt $file  `;
  16.     }
  17. ##Added by Ram K Maddela for deleting files from Server after Printer...    
  18.     `rm -f $file`;
  19. }
  20.  
Feb 5 '08 #1
5 2892
eWish
971 Expert 512MB
I would add the following this will tell you what params the script is seeing.

Before this section of code:
Expand|Select|Wrap|Line Numbers
  1. if (param()) {
  2.     my $dest = param('dest');
  3.     my $opt  = param('opt');
  4.     my $file = param('file');
  5.     my $user = param('user');
Add this section of code:
Expand|Select|Wrap|Line Numbers
  1. foreach my $key (param) {
  2.     print "<strong>$key</strong> -> ";
  3.     my @values = param($key);
  4.     print join(", ",@values),"<br>\n";
  5. }
--Kevin
Feb 5 '08 #2
Can any one tell me how to execute this CGI script.

what are the configurations are required. and where to place this script. and any link or something is required for webserver or something.


shafi
Feb 6 '08 #3
eWish
971 Expert 512MB
If you don't know how to execute the script then how do you know that the param() are not being set?

Since you are running is as CGI you will need a webserver.

--Kevin
Feb 6 '08 #4
I need details like where to keep this perl script.

what are the webervers are required for my program.
is it required to create any link between my program and webserver

please tell me those details

shafi
Feb 6 '08 #5
numberwhun
3,509 Expert Mod 2GB
I need details like where to keep this perl script.

what are the webervers are required for my program.
is it required to create any link between my program and webserver

please tell me those details

shafi

Well, assuming that you will be using the Apache web server, here is a tutorial for setting it up. That should tell you what you need to know.

Regards,

Jeff
Feb 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Carl Ogawa | last post by:
The following will stop to open test.pl due to using param('userid') and param('pwd'). Is there an alternative way to get data from HTML file to CGI file? I have to do this in the particular...
1
by: Cliff | last post by:
here's my code: my $sth = $dbhSQL->prepare('{call proc(?,?,?)}'); $sth->bind_param(1,"asd"); $sth->bind_param(2,"klm"); $sth->bind_param_inout(3,\$no_go, 1000); $sth->execute; print "no go =...
0
by: anonieko | last post by:
Add a reference to log4net.dll 1: In the APP.CONFIG write the following: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="log4net"...
31
by: N.Davis | last post by:
I am very new to Python, but have done plenty of development in C++ and Java. One thing I find weird about python is the idea of a module. Why is this needed when there are already the ideas of...
5
by: garyusenet | last post by:
I understand that Point is an object used for storing co-ordinates, such as mouse location. I can't figure out what the e's do in the above example can someone explain please. Thanks, Gary.
3
by: keithb | last post by:
What can I put in a stored procedure to control what gets returned by command.ExecuteNonQuery()? I already tried this: param = comm.CreateParameter(); param.ParameterName = "@Success"; ...
1
by: Rich | last post by:
Hello, I can update a dataset from my client app using a dataAdapter.Updatecommand when I add parameter values outside of the param declaration. But If I add the param values inline with the...
2
by: QTR | last post by:
Hello, I discovered a strange XSLT behaviour on Weblo 8.1. Let me explain it (see at the end my example XSLT): I call a template (1) with one parameter (A) which calls another template (2) with...
3
by: patelxxx | last post by:
Hi Guy's, Can you explain to me what is the 'Param Class' and what is it used for? I've just visited CPAN to find out what the Param Class however CPAN only shows the methods used by this class,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.