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

RE: [MacPerl] Thanks 4 HELP, it Works But.....




Simone wrote:
>In example in order to get forms variable I usally use this lines:
>
>if ($ENV{'REQUEST_METHOD'} eq 'POST')
>{
>	read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>	@pairs = split(/&/, $buffer);
>	foreach $pair (@pairs)
>	{
>		($name, $value) = split(/=/, $pair);
>		$value =~ tr/+/ /;
>		$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>		$value =~ tr/,/ /;
>		$contents{$name} = $value;
>	}
>}
>
>
>Is this valid for MacPerl ? I suppose no. :(

I use a slight variation:

$buffer =~ tr/+/ /;
$buffer =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$buffer =~ s/<!--(.|\n)*-->//g;
$buffer =~ s/<([^>]|\n)*>//g;

do this before the split statement.

>and what about path variables like
>$filepath = "/www/web/user/folder/file.txt";

The mac pathname delimiter is ":", not "/".  The easiest thing to do is
set an environment variable
and build pathnames based on its settints.

>
>are compatible ?
>
>I'm going to think that should not be so easy to make a porting of my
>existing script, on a Mac platform.... I've heard that on WindowsNT is
not
>so hard !
>
>I do not want to bore you and listmembers too much with my novice
>questions, so if you could forward me some links to online manuals,
where I
>can learn how to port my scripts on Mac will be enought.
>
>Thanks again for your courtesy.
>
>Simone Mannini
>
>(Florence-Italy)
>
>>Robert Sweeney wrote to you (in part) yesterday:
>>
>>>>Any free webserver can do this for you... you have to be online and
Know
>>>>your IP, but other than that, you can configure QuidProQuo for CGI
testing.
>>
>>Actually that is not quite correct. You do *not* need to be on line.
>>
>>You can run the server, and the browser, and a cgi script all together
on
>>one machine *off-line* using AppleTalk.
>>
>>        Set MacTCP to "LocalTalk"
>>        Set MacTCP to "Obtain Address Manually"
>>        Set MacTCP IP Address to a dummy number (e.g. 192.168.0.0)
>>        Restart the mchine (unfortunately required by MacTCP)
>>        Open Location with <http://192.168.0.0/myFile.html> (browser)
>>
>>Tom Kennedy recently wrote this:
>>
>>>FWIW: There is an RFC 1918:Address Allocation for Private Internets
that
>>>recommends IP addresses for such private networks. The short of it is
>>>that these addresses are reserved for private use. . .
>>>
>>>     10.0.0.0        -   10.255.255.255  (10/8 prefix)
>>>     172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
>>>     192.168.0.0     -   192.168.255.255 (192.168/16 prefix)
>>>
>>>I use 192.168.1.1 for my home testing. At the office, I setup a
private
>>>network using 192.168.1.* for a localtalk network.
>>
>>Hope this helps.  Have fun!
>>
>>Alan Fry
>
>
>  Simone
>  EU & DXZone WebMaster
>
>  1 EU 001 * 1 SD 234 * 15 KP 472 * 1 NF 066 * WAC 1051
>---------------------------------------------------------
>European Radio Club                                DXZone
>Echo Uniform                             Free DX Resource
>http://www.sitcar.com/eu     http://www.sitcar.com/dxzone
>_________________________________________________________
>
>
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.c
h
>
>RFC822 header
>-----------------------------------
>
>Return-Path: <neeri@iis.ee.ethz.ch>
>Received: from err.ethz.ch ([129.132.2.21])
>          by litnetserver.literacy.upenn.edu (Netscape Mail Server
v2.02)
>          with ESMTP id AAA146 for <linberg@literacy.upenn.edu>;
>          Tue, 11 Nov 1997 20:14:17 -0500
>Received: (from majordom@localhost)
>	by err.ethz.ch (8.8.7/8.8.5/IISmaster-1.76) id XAA06137
>	for mac-perl-outgoing; Tue, 11 Nov 1997 23:18:47 +0100 (MET)
>Received: from dada.it (root@mail.dada.it [194.184.248.4])
>	by err.ethz.ch (8.8.7/8.8.5/IISmaster-1.76) with ESMTP id XAA06126
>	for <mac-perl@iis.ee.ethz.ch>; Tue, 11 Nov 1997 23:18:23 +0100 (MET)
>Received: from [194.184.248.75] (dadovago75.dada.it [194.184.248.75]) by

>dada.it (8.8.5/8.7.3) with ESMTP id XAA01921; Tue, 11 Nov 1997 23:07:38
+0100
>X-Sender: eu001@mail.dada.it
>Message-Id: <v03102801b08e745577bd@[194.184.248.220]>
>In-Reply-To: <879262598.1016551.0@afco.demon.co.uk>
>Mime-Version: 1.0
>Content-Type: text/plain; charset="us-ascii"
>Date: Tue, 11 Nov 1997 23:11:00 +0200
>To: Alan Fry <ajf@afco.demon.co.uk>
>From: Simone <eu001@dada.it>
>Subject: [MacPerl] Thanks 4 HELP, it Works But.....
>Cc: mac-perl@iis.ee.ethz.ch
>Sender: owner-mac-perl@iis.ee.ethz.ch
>Precedence: bulk
>


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