Did I touch a nerve here or what?
Ge, all of this totally <favorite slang word> is confusing me,
So you know where I am coming from, I'm taking
a second on-line CGI/PERL class that leaves a lot to be desired (if anyone knows
a good up-todate on-line class, please let me know!)
I will move up to learning CGI.pm, but for this month, I need to learn
how share variables between PERL files.
So by way of example what do I need to add to my code so I can use the Strict Pragma?
I take it that this is considered bad programing style or is just out date,
like the <blink> tag in <html> :)
require "libcgi2.pl";
Also I don't understand this '::' syntax.
Thanks
Dave
(I would think that there are a few out there that might benefit from some
clarification)
-------- the library file "libcgi2.pl" --------
# used in guestout.pl and guestin.pl
$filename = 'guest_data/guest_data.txt';
#
sub parse_input {
$whichmethod = $ENV{'REQUEST_METHOD'};
if($whichmethod eq "GET"){
$forminfo = $ENV{"QUERY_STRING"};
}else{
$forminfo = <STDIN>; }
@key_value_pairs = split(/&/,$forminfo);
foreach $pair (@key_value_pairs){
($key,$value) = split(/=/,$pair);
$value =~ s/\+/ /g;
$value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg;
$FORM_DATA{$key} = $value;
}
}
--- more stuff ---
return 1;
__END__
---------- main perl executable, what is this package's $Name? -----
#!/usr/bin/perl -w
# CGI Script
use strict;
require "libcgi2.pl";
&parse_input; # sub in our library
#strip leading or trailing white space from all our form elements
foreach my $key (keys %FORM_DATA){
$FORM_DATA{$key} =~ s/^\s+|\s+$//g;
}
....ect.....
--------------
*====================================================*
* Cora Connection Your West African Music Source *
* http://www.coraconnection.com/ *
* Resources, Recordings, Instruments & More! *
*====================================================*