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?
In reply to My parsing not working by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |