Sponsored Content
Top Forums Shell Programming and Scripting Can't get my head wrapped around CGI/Perl Post 302280289 by sennex on Monday 26th of January 2009 12:24:38 PM
Old 01-26-2009
At this point I cannot, I think I found part of my problem though.
After more research I changed a few sections to this:

Code:
#!c:/perl/bin/perl.exe
#super.cgi - saves form data to a file, and creates a dynamic
#Web page that displays a message and survey statistics
print "Content-type: text/html\n\n";
use CGI qw(:standard);
use strict;

#declare variables
my ($name, $semm, @records);
#my @semm_count = (0, 0, 0, 0);
my %semm_count = ("1", 0,
				  "2", 0,
				  "3", 0,
				  "4", 0);

#calculate survey statistics
open(INFILE, ">>", "c05ex5.txt")
	or die "Error opening c05ex5.txt. $!, stopped";
@records = <INFILE>;
close(INFILE);
foreach my $rec (@records) {
	chomp($rec);
	($name, $semm) = split(/,/, $rec);
	$semm_count{$semm}++;
	}

#generate HTML acknowledgment
print "<HTML><HEAD><TITLE>WKRK-TV</TITLE></HEAD>\n";
print "<BODY>\n";
print "<H2>Seminar Total</H2>\n";

print "<TABLE>\n";
print "<TR><TD>Seminar</TD>    <TD>Total</TD></TR>\n";

foreach my $key ("Computer Maintenance", "Microsoft Office", "Unix Essentials", "CGI/PErl") {
	print "<TR><TD>$key</TD> <TD>$semm_count{$key}</TD></TR>\n";
	}

print "</TABLE>\n";
print "</BODY></HTML>\n";

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl CGI.pm

my box is FreeBSD4.3 and I use Perl 5.0005_03. Here is the CGI script. test.cgi ...... if ($query->action eq 'detail') { ...... print $query->hidden('action', 'modify'); ...... } I found that the result of test.cgi?action=detail is not what I expected. the script does not... (4 Replies)
Discussion started by: tonyt
4 Replies

2. UNIX for Dummies Questions & Answers

Apache Perl/CGI

Can any body help me with apache and cgi i'dont know how iconfigure apache to use cgi... and when i try to start apachectl it says there is no file... please help me...i have apache installed... (1 Reply)
Discussion started by: CreamHarry
1 Replies

3. Shell Programming and Scripting

perl+CGI+mysql !!!!!!!

hi expert, I am totally new to perl CGI coding. And stop by below issue: 1> i have a script names conn.pl, which can connect to mysql and get the information of table user(id,name) 2> i copied above code into one CGI web page named user.cgi 3> when i view user.cgi in web browser, it toldme... (3 Replies)
Discussion started by: summer_cherry
3 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

CGI in Perl

Hi, Am unfamiliar with using CGI modules in Perl. Though i checked in few sites about CGI , i dint get a clear idea. Can anyone please explain me the purpose of these statements, it ll be very helpful to me #!/usr/bin/perl use CGI qw/:standard/; use Storable; use Data::Dumper; my... (1 Reply)
Discussion started by: irudayaraj
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

10. UNIX for Dummies Questions & Answers

PERL-CGI learning

Hello All, I am actually learning PERL and more interested to learn CGI script too. Can any suggest a forum or weblink which is more helpful for a dummy CGI developer. Thanks (6 Replies)
Discussion started by: posix
6 Replies
Business::PayPal::API::TransactionSearch(3pm)		User Contributed Perl Documentation	     Business::PayPal::API::TransactionSearch(3pm)

NAME
Business::PayPal::API::TransactionSearch - PayPal TransactionSearch API SYNOPSIS
use Business::PayPal::API::TransactionSearch; ## see Business::PayPal::API documentation for parameters my $pp = new Business::PayPal::API::TransactionSearch ( ... ); my %response = $pp->TransactionSearch( StartDate => '1998-01-01T00:00:00Z', TransactionID => $transid, ); DESCRIPTION
Business::PayPal::API::TransactionSearch implements PayPal's TransactionSearch API using SOAP::Lite to make direct API calls to PayPal's SOAP API server. It also implements support for testing via PayPal's sandbox. Please see Business::PayPal::API for details on using the PayPal sandbox. TransactionSearch Implements PayPal's TransactionSearch API call. Supported parameters include: StartDate (required) EndDate Payer Receiver TransactionID PayerName AuctionItemNumber InvoiceID TransactionClass Amount CurrencyCode Status as described in the PayPal "Web Services API Reference" document. The syntax for StartDate is: YYYY-MM-DDTHH:MM:SSZ 'T' and 'Z' are literal characters 'T' and 'Z' respectively, e.g.: 2005-12-22T08:51:28Z Returns a list reference containing up to 100 matching records (as per the PayPal Web Services API). Each record is a hash reference with the following fields: Timestamp Timezone Type Payer PayerDisplayName TransactionID Status GrossAmount FeeAmount NetAmount Example: my $records = $pp->TransactionSearch( StartDate => '2006-03-21T22:29:55Z', InvoiceID => '599294993', ); for my $rec ( @$records ) { print "Record: "; print "TransactionID: " . $rec->{TransactionID} . " "; print "Payer Email: " . $rec->{Payer} . " "; print "Amount: " . $rec->{GrossAmount} . " "; } ERROR HANDLING See the ERROR HANDLING section of Business::PayPal::API for information on handling errors. EXPORT None by default. SEE ALSO
<https://developer.paypal.com/en_US/pdf/PP_APIReference.pdf> AUTHOR
Scot Wiersdorf <scott@perlcode.org> COPYRIGHT AND LICENSE
Copyright (C) 2006 by Scott Wiersdorf This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2009-12-07 Business::PayPal::API::TransactionSearch(3pm)
All times are GMT -4. The time now is 09:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy