•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 425,765 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,399 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 380 | Replies: 3
![]() |
•
•
Join Date: May 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
So I'm having a bit of a problem with a CGI script. It runs fine, except for the little problem that param(x) doesn't work at all. It will either crash the program or return an undefined value.
Thanks
perl Syntax (Toggle Plain Text)
#!/usr/bin/perl use warnings; use CGI qw(:standard ); $temp=uc(param('class')); $class=chomp ($temp); $temp=uc(param('type')); $type=chomp ($temp); $temp=uc(param('first')); $first=chomp ($temp); $temp=uc(param('last')); $last=chomp ($temp); $temp=param('area'); $areacode=chomp($temp); $temp=param('firstnum'); $first3=chomp($temp); $temp=param('secondnum'); $last4=chomp($temp); $temp=uc(param('carrier')); $carrier=chomp($temp); $num="$areacode$first3$last4"; open (PER, ">../data/USERS/$type/$first.$last.dat"); print (PER "$first $last\n$class\n$num\n$carrier"); close (PER); print ("Content-Type:text/html\n\n"); print "<html><body>"; print '<h4>Thank you. Please email the Administrator at <a href="mailto:apcsci@gmail.com">xxxx@gmail.com</a> with any questions or comments</h4>'; print "</body></html>";
Thanks
start with a simple script. Use a form with one text field: 'test'.
if that still crashes then your install of perl is bad or is maybe a non standard distribution.
#!/usr/bin/perl
use warnings;
use strict;
use CGI qw(:standard);
print header;
print start_html;
print param('test');
print end_html;if that still crashes then your install of perl is bad or is maybe a non standard distribution.
Last edited by KevinADC : May 28th, 2008 at 4:54 pm.
•
•
Join Date: May 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
somehow theres a problem in the
part, and not regarding the param('x'); call. the simple form worked fine, and i modified my script so that it doesn't convert to uppercase or chomp, and now it's working
EDIT: Well now I feel really stupid. $first=chomp($temp); would return the number of spaces removed, not the string after the spaces had been removed. Oops haha
perl Syntax (Toggle Plain Text)
$temp=uc(param('class')); $class=chomp ($temp);
EDIT: Well now I feel really stupid. $first=chomp($temp); would return the number of spaces removed, not the string after the spaces had been removed. Oops haha
Last edited by scuba183 : May 28th, 2008 at 9:11 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- really noobish (C++)
- RandomJumbleOfLetters.exe (Viruses, Spyware and other Nasties)
- multiple file searching (C)
- repetition problem (C++)
- C++ graphics (C++)
Other Threads in the Perl Forum
- Previous Thread: How to open a .exe file in the foreground
- Next Thread: Modifying a Perl script for multiple lines of html...


Linear Mode