Re: dos2unix... and other

2002-10-06 Thread Adriano Allora

Hi to all,
and thank you for the solutions you adviced me about the dos2unix 
problem (when I saw with the cat command that nvi doesn't change the 
content files I decided to substitute all the line endings with \n and 
stop there).
Now I have another problem: the 5.6 version perl on jaguar doesn't 
accept the escape character \s, does it?
When I use it in a regexp (s/\s+/\s/g;)(I want it works to singularize 
all the multi-whitespaces), the Terminal tells me:
Unrecognized escape \s passed through at cleaner line 27.

adr




Re: Expat 1.95.5 problems...

2002-10-06 Thread Geoffrey F. Green

On 10/6/02 1:43 PM, Jerry LeVan [EMAIL PROTECTED] wrote:

 Any one built the version of expat on Jag?

I just tried it, and it built fine (AFAICT).  See below.

Did you do anything funky with ./configure?

 - geoff

[ganda:~/Downloads/expat-1.95.5] geoff% make
/bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
-Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
lib/xmlparse.lo -c lib/xmlparse.c
/bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
-Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
lib/xmltok.lo -c lib/xmltok.c
/bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
-Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
lib/xmlrole.lo -c lib/xmlrole.c
/bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall -Wmissing-prototypes
-Wstrict-prototypes -fexceptions   -I./lib -I. -no-undefined -version-info
4:0:4 -rpath /usr/local/lib  -o libexpat.la lib/xmlparse.lo lib/xmltok.lo
lib/xmlrole.lo
gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
-I./lib -I. -o xmlwf/xmlwf.o -c xmlwf/xmlwf.c
gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
-I./lib -I. -o xmlwf/xmlfile.o -c xmlwf/xmlfile.c
gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
-I./lib -I. -o xmlwf/codepage.o -c xmlwf/codepage.c
gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
-I./lib -I. -o xmlwf/unixfilemap.o -c xmlwf/unixfilemap.c
/bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall -Wmissing-prototypes
-Wstrict-prototypes -fexceptions   -I./lib -I.  -o xmlwf/xmlwf xmlwf/xmlwf.o
xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/unixfilemap.o libexpat.la




Re: dos2unix... and other

2002-10-06 Thread John Delacour

At 5:46 pm +0200 6/10/02, Adriano Allora wrote:

When I use it in a regexp (s/\s+/\s/g;)(I want it works to 
singularize all the multi-whitespaces), the Terminal tells me:
Unrecognized escape \s passed through at cleaner line 27.

\s means ANY white space character, so in your substitution pattern 
it is meaningless;  instead you must use a space



 #!/usr/bin/perl -w
 $_ = lotsof   whitespace ;
 s~\s+~ ~g ;
 print ;

JD




Re: dos2unix

2002-10-06 Thread John Delacour

At 7:54 pm +0200 30/9/02, Adriano Allora wrote:

On the one hand I didn't express myself very well, but for the other
hand I found other aspects of the problem.

Actual situation: I work with mac osx.2, vi editor, a pack of dos
files to work on.
When I open my files with vi I see some strings instead of stressed
letters and signs.
For instance:
carriage return = ^M
u grave = \xf9
e grave = \xe8
a grave = \xe0
o grave = \xf2
euro sign = \x80
i grave = \xec
BUT, if I write the same letters and signs on the editor, they appears as:
carriage return =
a grave = \xc3\xa0
e grave = \xc3\xa8
e acute = \xc3\xa9
u grave = \xc3\xb9
i grave = \xc3\xac
o grave = \xc3\xb2
euro: \xe2\x82\xac

so, I don't know I can face the problem: to create an array of
strings to substitute is a non-sense, because of I haven't got two
lists in one-to-one correspondence... er, I suppose (I'm not sure).


I can't imagine using vi to do this sort of thing -- or anything
else, for that matter.  All you need to do is run the file through a
converter such as this, which converts from Latin-1 to Mac.  The Euro
sign does not exist in Latin-1, so you will have to discover which
charset (eg. windows-1252, iso-8859-15) is used in the original files
and change the table accordingly.  You can add your line-endings
conversion to the table as well.

Here I have used a string for the example.  You would normally take
input from a file and output to another file


#!/usr/bin/perl
#
_ = split /$\//, ùèàò€ì
ùèàò€ì ; #  =  \xf9\xe8\xe0\xf2\x80$/\xf9\xe8\xe0\xf2\x80
table();
for (_) {
   s~([\x80-\xFF])~$latin2mac{$1}~g;
   print $_$/;
}
## -- Mac output:
##   ˆ˜“
##   ˆ˜“
###
sub table {%latin2mac = (
\xFC = \x9F, \xFB = \x9E, \xFA = \x9C, \xF9 = \x9D,
\xE8 = \x8F, \xCB = \xE8, \xC0 = \xCB, \xBF = \xC0,
\xF8 = \xBF, \xF6 = \x9A, \xF5 = \x9B, \xF4 = \x99,
\xF3 = \x97, \xF2 = \x98, \xF1 = \x96, \xEF = \x95,
\xEE = \x94, \xED = \x92, \xEC = \x93, \xEB = \x91,
\xEA = \x90, \xE9 = \x8E, \xE7 = \x8D, \xE6 = \xBE,
\xE5 = \x8C, \xE4 = \x8A, \xE3 = \x8B, \xE2 = \x89,
\xE1 = \x87, \xE0 = \x88, \xA7 = \xA4, \xDF = \xA7,
\xDC = \x86, \xDB = \xF3, \xDA = \xF2, \xD9 = \xF4,
\xAF = \xF8, \xD8 = \xAF, \xFF = \xD8, \xD6 = \x85,
\xF7 = \xD6, \xD4 = \xEF, \xD3 = \xEE, \xD2 = \xF1,
\xD1 = \x84, \xCF = \xEC, \xCE = \xEB, \xCD = \xEA,
\xD5 = \xCD, \xCC = \xED, \xCA = \xE6, \xC9 = \x83,
\xC8 = \xE9, \xC7 = \x82, \xC2 = \xE5, \xAC = \xC2,
\xA8 = \xAC, \xAE = \xA8, \xC6 = \xAE, \xC5 = \x81,
\xC4 = \x80, \xC3 = \xCC, \xC1 = \xE7, \xAB = \xC7,
\xBA = \xBC, \xB8 = \xFC, \xB7 = \xFA, \xB6 = \xA6,
\xB4 = \xAB, \xA1 = \xC1, \xB0 = \xA1, \xBB = \xC8,
\xAA = \xBB, \xA5 = \xB4, \xA0 = \xCA);}






Re: dos2unix... and other

2002-10-06 Thread Rich Morin

At 5:46 PM +0200 10/6/02, Adriano Allora wrote:
Now I have another problem: the 5.6 version perl on jaguar doesn't accept
the escape character \s, does it?
When I use it in a regexp (s/\s+/\s/g;)(I want it works to singularize
all the multi-whitespaces), the Terminal tells me:
Unrecognized escape \s passed through at cleaner line 27.

I think the problem is that \s does not specify a single character; rather,
it matches a set of characters.  So, when you ask Perl to substitute in \s,
what character should Perl use?  Here are two alternatives (among many :-):

   s|\s+| |g;# use a single space
   s|(\s)\s*|$1|g;   # use the first whitespace character

-r
-- 
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm- my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection



Re: Expat 1.95.5 problems...

2002-10-06 Thread Jerry LeVan

Evidently configure did something funky to me!

It added a --traditional-cpp flag to the CC define. I was able to
Do the build after I deleted the flag.

Thanks for the heads up.

--Jerry

I took it out
 On 10/6/02 1:43 PM, Jerry LeVan [EMAIL PROTECTED] wrote:
 
 Any one built the version of expat on Jag?
 
 I just tried it, and it built fine (AFAICT).  See below.
 
 Did you do anything funky with ./configure?
 
 - geoff
 
 [ganda:~/Downloads/expat-1.95.5] geoff% make
 /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
 -Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
 lib/xmlparse.lo -c lib/xmlparse.c
 /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
 -Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
 lib/xmltok.lo -c lib/xmltok.c
 /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall
 -Wmissing-prototypes -Wstrict-prototypes -fexceptions   -I./lib -I. -o
 lib/xmlrole.lo -c lib/xmlrole.c
 /bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall
 -Wmissing-prototypes
 -Wstrict-prototypes -fexceptions   -I./lib -I. -no-undefined
 -version-info
 4:0:4 -rpath /usr/local/lib  -o libexpat.la lib/xmlparse.lo
 lib/xmltok.lo
 lib/xmlrole.lo
 gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
 -I./lib -I. -o xmlwf/xmlwf.o -c xmlwf/xmlwf.c
 gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
 -I./lib -I. -o xmlwf/xmlfile.o -c xmlwf/xmlfile.c
 gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
 -I./lib -I. -o xmlwf/codepage.o -c xmlwf/codepage.c
 gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
 -I./lib -I. -o xmlwf/unixfilemap.o -c xmlwf/unixfilemap.c
 /bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall
 -Wmissing-prototypes
 -Wstrict-prototypes -fexceptions   -I./lib -I.  -o xmlwf/xmlwf
 xmlwf/xmlwf.o
 xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/unixfilemap.o libexpat.la
 




Tk, Perl, and 10.2

2002-10-06 Thread Ward W. Vuillemot

Anyone else running Tk, Perl 5.8.0 on Mac 10.2?

Anyone notice lag in window draw?  I have a G4 800 Mhz, but draw of 
even simple dialogs takes 1-2 secondsI am wondering if it is my 
configuration, or something else.  Am I correct when I say that Tk is 
_only_ available by running XDarwin (i.e. Fink installation) to get Tk 
running?  Is this just XDarwin overhead?

Thanks!
Ward