
02walshe
Novice
May 7, 2011, 5:29 PM
Post #1 of 3
(1731 views)
|
|
Global symbol "$first_name" requires explicit package name at form2.cgi line 23.
|
Can't Post
|
|
Hi, I'm having some real problems getting one of my scripts to work, and as far as I can see there's nothing wrong with it. The error messages I'm getting are:
syntax error at form2.cgi line 23, near "my " Global symbol "$first_name" requires explicit package name at form2.cgi line 23. Global symbol "$first_name" requires explicit package name at form2.cgi line 37. Execution of form2.cgi aborted due to compilation errors. The errors are from this script:
#!/usr/bin/perl # This is the website form script for processing of user data. # This form is used to capture the user's details, sets them as variables, and then uses them to generate the next page for the user. # This page is currently on Version: 0.2 # Use Strict to conform with all PERL language Rules use strict; # Load CGI standard variables use CGI ':standard'; # Allow all EM's to be put to Browser (Disable during production enviroments) use CGI::Carp qw(fatalsToBrowser warningsToBrowser); print "Content-type: text/html\n\n"; warningsToBrowser(1); use lib '/home/sites/website.com/cgi-bin'; require "BookPSW_Friend_Confirm.lib" # Code to turn user's input into PERL variables for First User my $first_name = param('firstname'); my $last_name = param('lastname'); my $email_address = param('emailaddress'); my $email_address_confirmation = param('emailaddressconfirmation'); # Code to turn user's input into PERL variables for friend my $ffirst_name = param('friendfirstname'); my $flast_name = param('friendlastname'); my $femail_address = param('friendemailaddress'); my $femail_address_confirmation = param('friendemailaddressconfirmation'); # Code to generate the next page &friendgeneratedpage($first_name,$last_name,$email_address,$ffirst_name,$flast_name,$femail_address); yet my other script which is pretty much identical, works without any problems:
#!/usr/bin/perl # This is the website form script for processingo of user data. # This form is used to capture the user's details, sets them as variables, and then uses them to generate the next page for the user. # This page is currently on Version: 0.2 # Use Strict to conform with all PERL language Rules use strict; # Load CGI standard variables use CGI ':standard'; # Allow all EM's to be put to Browser (Disable during production enviroments) use CGI::Carp qw(fatalsToBrowser warningsToBrowser); print "Content-type: text/html\n\n"; warningsToBrowser(1); use lib '/home/sites/website.com/cgi-bin'; require "BookPSW_Solo_Confirm.lib"; # Code to turn user's input into PERL variables for First User my $first_name = param('firstname'); my $last_name = param('lastname'); my $email_address = param('emailaddress'); my $email_address_confirmation = param('emailaddressconfirmation'); # Code to generate the next page &sologeneratedpage($first_name,$last_name,$email_address); the website.com part points to the real website address on my server, but I've generalised it for privacy... So, anyone any ideas? The variable is being set before being used, so I can't see what's going wrong... thanks, 02walshe
|