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

Re: [MacPerl] MacPerl bugs?



At 9.46 -0400 1999.06.02, Scott Prince wrote:
>>>if ($^O =~ /mac/) { #.... }
>>># then later on...
>>>$z = eval {/$x/};
>>># but wait, eval no longer works!
>>># removing the ($^O =~ /mac/) verified this.
>>
>>/mac/ won't match $^O on MacPerl.  It might match some other OS's, like
>>machten.  $^O for MacPerl is "MacOS".  See perlport.pod (on
>>http://pudge.net/macperl/ and in perl5.004_05 and higher).
>
>Actually I believe I used a case insensitive match:
>
>if ($^O =~ /mac/i)
>
>laziness on my part, instead of checking what $^O returns for the mac,
>just matched on it. But how would that change eval? I should also have
>noted that both examples are saved as cgi's served up with Web Sharing.

I don't know what you mean by "eval no longer works", I guess.  See what
Paul said.

>Right you are. In this case the file is an uploaded file and it seems
>that it may be related to using cgi-lib.pl. Is CGI.pm a more compatible
>solution for this?

CGI.pm is better in general.  I don't know what isn't working for you, so I
cannot say offhand if it would work or not.

>I have been attempting to have one cgi script that will run on Mac or
>Unix by changing only one line in the script. Maybe that's asking too
>much, but I love my Mac and hate the Unix text editors. It would be nice
>to have one subroutine that would handle all the little quirks; flock,
>file sys delimiters, \r\n, etc.

For flock, you are stuck.  There's no easy way around it.  For file paths,
use File::Spec, File::Basename, etc.  For \r\n ... don't use them together
at all, ever, for portable programs.  Use \015\012 for socket
communications, and \n for local newline.

perlport has all this information and more.  Anyone who is doing
cross-platform programming in Perl should read it.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org