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

Re: [MacPerl] MacPerl bugs?



On Wed, Jun 02, 1999 at 09:46:50AM -0400, Scott Prince wrote:
> 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.

It wouldn't change eval.


> >I wonder what version you have?  Using the 5.2.0r4 (the latest), I try:
> >
> >  $_ = "a\tb\tc\t\t\t\n"; # read in from a database file
> >  @x = split (/\t/, $_);
> >  print scalar @x;
> >
> >It prints "6".
> 
> 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?

Neither cgi-lib.pl nor CGI.pm will have any effect on builtin functions
such as split().

Are you sure that the string ends with a newline when you split it?  If
your string is more like "a\tb\tc\t\t\t", then you _will_ get 3, because
split() drops trailing null fields by default.


> 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.

I think that's asking too little.  You should be able to run it without
changing any lines at all!

Ronald

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