-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"Mads Jensen" <astrup_jensen.NOSPAM@hotmail.com> writes:
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
>
> sub splitqs {
> read(STDIN, $input,$ENV{CONTENT_LENGTH});
> @pairs = split(/&/, $input); // split up the pairs;
> foreach $pair (@pairs){
> ($key,$val) = split(/=/,$pair); // split name and value
>
> $val =~ tr/+/ /; // replace +'s with spaces
> $val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> $key =~ tr/+/ /;
> $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> // return an associative array/hash:
> $IND{$key} = $val;
> }
> }
>
> &splitqs;
>
> print "<html>";
> print "\t<head>\n";
> print "\t\t<title></title>\n";
> print "\t</head>\n";
> print "\t<body>\n";
> print "\tThis is the output of my first real PERL script:\n";
>
> foreach $name (keys(%IND)){
> print "The value of $name was $IND{$name}\n";
> }
>
> print "\t</body>\n";
> print "</html>";
>
> Har siddet og bakset lidt med dette, men kan ikke rigtig finde fejlen. Får
> bare en 500 fejl i hovedet!
Du kunne jo prøve at kigge i error loggen... Og så ville du finde ud
af at perl ikke bruger // som kommentar tegn... Det er #
> PS:
> Er der nogen, der kender en god oversigt til det med regex i PERL, da ting
> som s/ gi/ osv. er lidt svære at holde rede på
man perlre
- --
Dennis
I have always thought explanations were overkill when correcting
mistakes. A simple "that's wrong" must suffice. I mean, people are
always aware why they are wrong. They just make mistakes to annoy you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <
http://mailcrypt.sourceforge.net/>
iD8DBQE+Q75wo6hqeoa8JFgRAjSRAJ0QB5MEZ23BH4NAsL7huMMR9WOQVgCgkl/o
0HZp6Th8eHpSxbUW02HSOG0=
=q9mJ
-----END PGP SIGNATURE-----