[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] CGI question



At 17.19 10/6/97, Davey... wrote:
>
># Split the name-value pairs
>@pairs = split(/&/, $buffer);
>
>foreach $pair (@pairs) {
>   ($name, $value) = split(/=/, $pair);
>
>   # Un-Webify plus signs and %-encoding
>   $value =~ tr/+/ /;
>   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>   $value =~ s/<!--(.|\n)*-->//g;
>   $value =~ s/<([^>]|\n)*>//g;
>
>   $FORM{$name} = $value;
>}
>
>the problem I am running into this time is this.. this time the output of
>the form is VERY sensitive to linefeeds from the <TEXTAREA>(^M) and crashes
>when it gets one.  I tried to add a filter like the one above to change ^M
>to a space, but I didn't hit on the correct syntax to make it work.
>
>hope this wasn't to symplistic.. but, hey.. I am learning.

Your problem seems to be that \n on Macs is \015 and \n on UNIX is \012.
But forms send both, \015\012.

--
Chris Nandor             pudge@pobox.com             http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch