Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Before you reply note that I dont want to use CGI.pm's param function. Just my own
This doesnt seem to be working when I execute my script with index.cgi?boo=a, It will print No
#!/usr/bin/perl #-------------INFO---------------# ## Matrix 1.0 ## Author: Andrew Rosolino ## Site: http://www.webewebin.com #-------------START--------------# ## Load Modules use CGI::Carp "fatalsToBrowser"; use DBI; &ReadParse; print "Content-type: text/html\n\n"; if($in{'boo'}) { print "Yea"; } else { print "No"; } ### Read Parse sub ReadParse { local (*in) = @_ if @_; local ($i, $key, $val); # Read in text read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); @in = split(/[&;]/,$in); foreach $i (0 .. $#in) { # Convert plus's to spaces $in[$i] =~ s/\+/ /g; # Split into key and value. ($key, $val) = split(/=/,$in[$i],2); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Associate key and value $in{$key} = $val; } }
Shouldnt that be printing yes?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My parsing not working
by iburrell (Chaplain) on Nov 02, 2002 at 00:34 UTC | |
|
Re: My parsing not working
by Thelonius (Priest) on Nov 02, 2002 at 00:37 UTC | |
|
Re: My parsing not working
by Louis_Wu (Chaplain) on Nov 02, 2002 at 00:12 UTC |