Parsing UTF8 files with wide characters

2005-06-15 Thread Robin
I thought I'd understood how to use unicode support in perl, but 
evidently not. In the script below, I'm stumped as to:


1) why the regex won't match ''.
2) why the substitution is carried out, but the result isn't in UTF8, 
nor is it UTF8 re-encoded in UTF8 (uncomment #require Encode; 
... #Encode::decode_utf8($_); to test this )




TIA


Robin



 #!/usr/bin/perl -w

use strict;
use diagnostics-verbose;
#require Encode;


binmode (DATA,:utf8);


binmode (STDOUT,:utf8);


for (DATA){

if (/([EMAIL PROTECTED])/gs){
print match: ,$1,\n;
#Encode::decode_utf8($_);
s/$1//gs;

}elsif(/()/gs){
print match: ,$1,\n;
s/$1/12/gs;


}

print;

}   




__DATA__
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
HTML
HEAD
META HTTP-EQUIV=content-type CONTENT=text/html; charset=utf-8
TITLE A Web Page/TITLE  
/HEAD
BODY
BLOCKQUOTE
H3newsFONT COLOR=#FF33001/FONT/H3
... and this is a web page.
P
IMG ALT=A Filler WIDTH=450 HEIGHT=296
P
hidden marker here -FONT 
COLOR=#FF3300[EMAIL PROTECTED]/FONT--BR

/BLOCKQUOTE
/BODY
/HTML




Re: Parsing UTF8 files with wide characters

2005-06-15 Thread Robin

thanks Andrew and Sherm

I went back to look at perluniintro because I was sure I could remember 
reading that the use utf8 pragma was no longer needed, right under 
where it says this it continues Only one case remains where an 
explicit use utf8 is needed: if your Perl script itself is encoded in 
UTF-8


*sigh*

Robin



Parsing Jpeg files for comments

2005-06-08 Thread Robin

I've googled about for this but to no avail:


I'm making a perl frontend to a mySQL server to serve up images. Some 
of the images are jpegs with keywords stored as comments in the file, 
and I want to be able to access those comments through perl. Is there a 
module which already exists which does this?


tia


Robin



Re: ActiveState is announcing support for Mac OS X

2005-06-08 Thread Robin

erm try Cpanplus maybe?

I understood that Cpan was no longer being actively developed.


Robin


On 9 Jun 2005, at 05:43, David Cantrell wrote:


Lola Lee wrote:

David Cantrell wrote:

John Delacour wrote:

Getting CPAN to behave is also a black art.

I wonder what you're doing wrong, then.
I'm not the only one.  There's a couple modules that I haven't been 
able to get to compile lately, such as WebService::GoogleHack, and I 
don't know why it's not working. Yes, I entered the google key and 
the paths, but the tests tell me nothing except that it failed.


I'd be inclined to think that the module author has screwed up, rather 
than that CPAN is at fault.


--
David Cantrell | top google result for internet beard fetish club

I often think that if we Brits had any gratitude in our hearts, we
would put up a statue to Heinz Guderian - who probably saved us 
from

ruin by booting our Army off the continent before we could do
ourselves real harm.
   -- Mike Stone, in soc.history.what-if





Re: Parsing Jpeg files for comments

2005-06-08 Thread Robin

On 8 Jun 2005, at 20:01, Chris Devers wrote:


On Wed, 8 Jun 2005, Robin wrote:


I've googled about for this but to no avail:


Try search.cpan.org next time :-)


I'm hurt you think I didn't :)


Yes:  Image::Info.


this was the first thing I found and downloaded and is great for  
getting info about the jpeg itself, but not what I needed in this  
particular case.


On 8 Jun 2005, at 16:41, Paul Mison wrote:

Oh, JFIF comments? Either JPEG::JFIF or  or the scarily comprehensive  
looking Image::Metadata::JPEG might be better than the other two  
modules I just mentioned.


http://search.cpan.org/~krzak/JFIF/JFIF.pm  
http://search.cpan.org/~bettelli/Image-MetaData-JPEG/lib/Image/ 
MetaData/JPEG.pod




Ah hah! it looks like I was using the wrong terms to search, hence  
drawing blanks, ahh the curse of jargon. This indeed looks like what I  
need - tankee sir.



Robin



Re: CPAN can't write makefiles after perl 5.8.1 reinstall on 10.3.4

2004-07-15 Thread Robin
On 15 Jul 2004, at 06:43, Brian Dimeler wrote:
 I can't install --anything-- with CPAN. Any time it gets to the 
Writing makefile for whatever.. step I get a -- NOT OK,
oddly enough I had the same problem with a just-out-of-the-box iBook 
trying to install Net::FTP with CPAN.

I ended up cd-ing to the CPAN directory and doing a manual make there 
(make; make test; make install).

Specs:
OSX Mac OS X 10.3.4 (7H63)
perl, v5.8.1-RC3 built for darwin-thread-multi-2level
Robin


Parsing and merging plist files

2004-07-14 Thread Robin
been googling around for this but I'm not running into what I need:
I have accounts on 4 macs running OSX, in 4 separate physical 
locations, so I'm looking to sync things like mail rules, ical files 
and bookmarks (Safari, Omniweb).

The strategy I'm aiming to adopt is using cron perl job (or jobs) to 
check for changes, merging and storing a central copy of the files in 
question on a central 24/7 server as required.

With the exception of Omniweb bookmarks, everything else is in a kind 
of plist. Ages ago I threw together a hack for iCal files that does 
work (sort of) and I've read about Mac::plist but am left with the 
impression it's as quirky as my current iCal solution, so (yes I 
finally got to the question I want to ask):

Has anyone been here? Tips? Warnings? Encouragement?
Is there are more reliable parser than Mac::plist?
TIA
Robin


Re: xterm color support

2004-01-23 Thread Robin
Oddly enough I was just looking into ANSI escapes for the mud I was 
banging on about in another thread and came to the conclusion Why use 
a module when you can just pepper your text with ANSI escape codes? :

ANSI Color Codes in brief:

  0to restore default color
  1for brighter colors
  4for underlined text
  5for flashing text
 30for black foreground
 31for red foreground
 32for green foreground
 33for yellow (or brown) foreground
 34for blue foreground
 35for purple foreground
 36for cyan foreground
 37for white (or gray) foreground
 40for black background
 41for red background
 42for green background
 43for yellow (or brown) background
 44for blue background
 45for purple background
 46for cyan background
 47for white (or gray) background
you use the above codes together with an escape sequence like this 
(replace the '#' with the colour code of your choice) :

\e[#m

Once you've used an escape all subsequent text will be affected until 
you use the reset escape

\e[0m

so if I want to format a part of a line of text, instead of:

print This boring old line of text was supposed to have red text\n;

do this:

print This new improved, brighter, more interesting line of text has 
\e[31mred text\e[0m\n ;

or maybe even liberally chucking in a bit of '\e[5m' to really endear 
you to users, if you want to use two escapes on the same piece of text 
use one of these ';' :

\e[#;#m

print This \e[5m new improved \e[0m, \e[5m brighter \e[0m, more 
\e[5minteresting \e[0m line of text has \e[31;5mflashing red 
text\e[0m\n ;

A fuller listing of ANSI ecapes can be found here:

http://en2.wikipedia.org/wiki/ANSI_escape_code

Note the implmentation of ANSI varies wildly, so expect colour and 
(possibly) formatting but not consistency. Especially from Mircrosoft 
:).

HTH

Robin





On Sunday, January 18, 2004, at 01:54  pm, gohaku wrote:

Hi everyone,
I have a question about the following script:
use Term::ANSIColor;
print color(red on_white), Danger, Will Robinson!\n;
print color(red on_white), Danger, Will Robinson!\n;
print color(red on_white), Danger, Will Robinson!\n;
print color(reset);
For some reason, the 1st line has only Red Text on a White Background, 
while the last 2 lines have only Red Text.
There doesn't seem to be any problems with lynx and colored text.
I am using v1.07 of  Term::ANSIColor.
Has anybody experienced the same problem or is there a problem with my 
script?
Thanks in advance.
-Gohaku



Re: xterm color support

2004-01-23 Thread Robin
On Saturday, January 24, 2004, at 12:18  am, Wiggins d Anconia wrote:
Readability?  Why use a module for anything?
It's not exactly rocket science to understand the escapes and 
seriously, using a print for each and every escape code format ? 
Expensive much? And what about situations where you can't use print 
like a multiplexing socket?

Modules are good, but then sometimes the price they ask is too high for 
what they actually do. IMHO of course.

Note the implmentation of ANSI varies wildly, so expect colour and
(possibly) formatting but not consistency. Especially from Mircrosoft
:).
Another good argument for using the module...
It's not magic, it has no silver bullet to ensure every terminal will 
show the same colours/formats, simply because the module uses the same 
escape codes I listed in my earlier posting, being as they are ANSI 
standards :).

Robin



Re: xterm color support

2004-01-23 Thread Robin
On Saturday, January 24, 2004, at 12:18  am, Wiggins d Anconia wrote:
---snip--

as we seem to be adding nothing to the discussion I suggest we take 
this off list

Robin



Mud - security, data management

2004-01-16 Thread Robin
Hi there

to expand my own programming horizons, I'm looking at writing a mud 
from scrtach in perl, after looking at Perl Mud from boutell.com.

Currently I'm consulting Advanced Perl Programming but I thought it 
mught be intersesting to ask here for input on the following areas:

1] security (noted that I have read perlsec) -  what kind of exploits 
can I expect the mud to be subject to? How can I protect against them ?

2] how to deal with a large volume of data stored in data structures 
without using a mysql or other database server (must be a perl only 
solution), and without using exeternal modules like freeze/thaw etc.



TIA

Robin




Re: Perl, cron and prebinding puzzle.

2003-12-17 Thread Robin
Ok thanks Sherm that was the problem, I presume the prebinding errors 
are because perl is being passed the equivalent of
\quoted/data\
 and the fall out registers as a prebinding error

thanks again

Robin



On Wednesday, December 17, 2003, at 05:37  pm, Sherm Pendley wrote:

On Dec 17, 2003, at 1:02 AM, Robin wrote:

I have the following script
...snip...

which runs as expected from the command line, but entered in my 
(admin) crontab thus

5 * * * * /Users/robin/cron.pl

outputs nothing, not even errors
Output from a cron script is emailed to the user, unless otherwise 
redirected. IIRC, local mail delivery isn't enabled by default, so any 
errors generated by your script are probably getting lost in the  ether.

Try redirecting both stdout  stderr to a file, like this:

5 * * * * /Users/robin/cron.pl  /tmp/cronout.txt 21

Note the lack of quotation marks - In the tests I ran, cron would 
silently refuse to run my script if I quoted it. That's probably 
what's happening in your case.

sherm--



Perl, cron and prebinding puzzle.

2003-12-16 Thread Robin
I have the following script

#!/usr/bin/perl -w

open (OUT , /Users/robin/env.cron) || die;

$ENV{'RUN_AT'}= localtime;

for $key(keys(%ENV)){ print OUT $key, = ,$ENV{$key},\n; }
close (OUT);
which runs as expected from the command line, but entered in my (admin) 
crontab thus

5 * * * * /Users/robin/cron.pl

outputs nothing, not even errors, however in the syslog I see:

Dec 17 14:52:01 white /usr/libexec/fix_prebinding: 2003-12-17 14:52:01 
+0900: prebinding for perl done.
Dec 17 14:53:20 white /usr/libexec/fix_prebinding: /usr/bin/perl could 
not be launched prebound.
Dec 17 14:53:20 white /usr/libexec/fix_prebinding: /usr/bin/perl 
couldn't be prebound in the past, and probably can't be prebound now.
Dec 17 14:53:20 white /usr/libexec/fix_prebinding: 2003-12-17 14:53:20 
+0900: prebinding for perl done.
Dec 17 14:53:35 white /usr/libexec/fix_prebinding: /usr/bin/perl could 
not be launched prebound.
Dec 17 14:53:35 white /usr/libexec/fix_prebinding: /usr/bin/perl 
couldn't be prebound in the past, and probably can't be prebound now.
Dec 17 14:53:35 white /usr/libexec/fix_prebinding: 2003-12-17 14:53:35 
+0900: prebinding for perl done.
Dec 17 14:55:35 white /usr/libexec/fix_prebinding: fix_prebinding 
quitting for now.



what gives?

tia

Robin

Re: installing ming on Jaguar success(long-ish)

2003-12-12 Thread Robin
I'm crossposting this into the OSX perl mailing list as I was basically  
trying to get ming to work with perl.

Where I left off - stymied at getting the ming lib (  
http://www.opaque.net/ming/ ) to compile (original post appended at end  
of this one), so I went back and read the instructions for the OSX  
Jaguar patch ( http://www.haque.net/software/ ),  which say
'zcat ming-0.2a-mhaque-darwin-jaguar.patch.gz | patch -p0'  
while in the ming directory 

Being new to dealing with ports to OSX I had no idea what that meant,  
so after reading through the man pages for zcat, flex, bison, and patch  
(old Unix hands no laughing please) I figured out that typing the above  
line with correct paths in the terminal would actually modify the ming  
make file.

Make file thus patched, I  ran make and, a couple or warnings aside,  
everything seemed groovey, then make install and lo I now have the  
following in /usr/lib:

libming.a
libming.dylib
libming.so
libming.so.0
libming.so.0.2
Next I went on to install the perl wrapper which comes wih the distro  
using the standard proceedure for perl modules
perl Makefile.PL
make
make test
make install

make test output thus:

PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e  
test_harness(0, 'blib/lib', 'blib/arch') t/*.t
t/00_basicok
t/01_shapeok
t/03_movieok
t/button..ok
t/dragok
t/fillok
t/filljpegTest header seen more than once!
t/filljpegFAILED tests 1-2
Failed 2/2 tests, 0.00% okay
t/gradientok
t/png.Test header seen more than once!
t/png.FAILED test 1
Failed 1/1 tests, 0.00% okay
t/sound...Test header seen more than once!
t/sound...FAILED tests 1-3
Failed 3/3 tests, 0.00% okay
t/sprite..ok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed
 
---
t/filljpeg.t22 100.00%  1-2
t/png.t 11 100.00%  1
t/sound.t   33 100.00%  1-3
Failed 3/11 test scripts, 72.73% okay. 6/26 subtests failed, 76.92%  
okay.
make: *** [test_dynamic] Error 2

Not knowing if these tests were crucial or not I forced the install

Next I run a test script to see if I have a working distro or not:

#!/usr/bin/perl -w
use strict;
use SWF qw(:ALL);
my($font,$movie,$text);

SWF::setScale(1.0);

$font = new SWF::Font(/Users/robin/Desktop/serif.fdb);
$text = new SWF::Text();
$text-setFont($font);
$text-moveTo(200, 2400);
$text-setColor(0xff, 0xff, 0x99);
$text-setHeight(1000);
$text-addString(It works!);
$movie = new SWF::Movie();
$movie-setDimension(5400, 3600);
$movie-add($text);

$movie-save(/Users/robin/Desktop/SWFtest.swf);

this failed because there was no .fdb file on my computer, Flash needs  
a special font definition for each font used apparently, but luckily  
O'Reilly has a book out about Perl and graphics and the author has a  
.fdb file on his web site:

http://shawn.apocabilly.org/PGP/examples/serif.fdb

Once I'd downloaded the .fdb, and ammended the script, I got it to run,  
and I could view the sweat of my labours as it were. So there you go  
open source flash animations. Oh and just incase you didn't know  
Quicktime viewer can handle raw SWF files.

I'm hoping to produce animations with sound using ming/perl, anyone  
interested in knowing how and if the project develops drop me a line  
off list.



On Friday, December 12, 2003, at 09:52  am, Robin wrote:



I'm attempting to install the ming2.0a lib, there are some errors  
being thrown up by make (included below) and that's as far as I get.

Digging around on the web I found a Darwin/OSX patch but not  
instructions on how to use said patch, beyond those on the webpage,  
and I'm not using fink.

http://www.haque.net/software/

http://www.haque.net/software/patches/ming-0.2a-mhaque-darwin- 
jaguar.patch.gz



any suggestions/ links welcomed

Robin



Make output:

cd src  make dynamic
gcc -g -Wall-c -o movie.o movie.c
gcc -g -Wall-c -o displaylist.o displaylist.c
gcc -g -Wall-c -o blocklist.o blocklist.c
gcc -g -Wall-c -o position.o position.c
gcc -g -Wall-c -o movieclip.o movieclip.c
gcc -g -Wall-c -o shape_util.o shape_util.c
gcc -g -Wall-c -o shape_cubic.o shape_cubic.c
shape_cubic.c: In function `subdivideCubicLeft':
shape_cubic.c:53: warning: implicit declaration of function `memcpy'
gcc -g -Wall-c -o text_util.o text_util.c
gcc -g -Wall-c -o fill.o fill.c
gcc -g -Wall-c -o ming.o ming.c
cd blocks  make
gcc -g -Wall-c -o output.o output.c
gcc -g -Wall-c -o character.o character.c
gcc -g -Wall-c -o shape.o shape.c
gcc -g -Wall-c -o morph.o morph.c
gcc -g -Wall-c -o fillstyle.o fillstyle.c
gcc -g -Wall-c -o matrix.o matrix.c
gcc -g -Wall-c -o font.o font.c
gcc -g -Wall-c -o block.o block.c
gcc -g -Wall-c -o cxform.o cxform.c
gcc -g -Wall-c -o text.o text.c
gcc -g -Wall-c -o

Re: get contents from clipboard

2003-12-11 Thread Robin
late in on this one but you can treat the clipboard as a filehandle if 
you pipe to pbpaste and pbcopy :

open (FROM_CLIPBOARD, pbpaste|);
open (TO_CLIPBOARD, |pbcopy);
you can then do as you normally would for moving data to and from fle 
handles. See the typically useful-in-a-real-world-situation example 
script below below which uses this technique - copy a word to the 
clipboard, run the script and it will place a backewards version on the 
clipboard to be pasted where ever.

#!/usr/bin/perl -w

use strict;
my($data,$word);
my(@letters);
open (FROM_CLIPBOARD, pbpaste|);
open (TO_CLIPBOARD, |pbcopy);
$data=FROM_CLIPBOARD;

if ($data){ $word=$data ;}
else { $word = forwards; }
@letters=split(//,$word);

print TO_CLIPBOARD reverse(@letters),\n;

close (FROM_CLIPBOARD);
close (TO_CLIPBOARD);


On Tuesday, November 25, 2003, at 09:25  am, Jay Young wrote:

Is it possible to get the contents from the clipboard with Perl?  
Looking in a book I see - Win32::Clipboard

but is it possible to get it on the Mac in OS 10.3?

Thanks.

Jay




Re: japanese in regular expressions possible?

2003-08-14 Thread Robin
On Thursday, August 14, 2003, at 05:40  pm, Joel Rees wrote:

I really wanted to use Japanese 
my experiences mirror yours pretty closely

Am I expecting too much, too early?
I always put my lack of success down to my missing something vital in 
the knowledge department (and getting my hands on CJKV Information 
Processing is proving tougher than I had imagined). I assume my own 
ineptitude due to the fact Japanese perlers were doing regex 
substitutions before 5.8, granted they did most of the groundwork which 
perl now does for you (thanks Dan).

What are you guys doing for these?
I'm ashamed to admit it but I currently cop out and use English for web 
pages that will be processed by perl

Robin



Re: Ordering keys in a hash

2003-08-06 Thread Robin
On Wednesday, August 6, 2003, at 12:31  am, Jeff Lowrey wrote:

At 04:12 PM 8/5/03 +0100, Adam Witney wrote:
Hi,

I have a hash with keys of the format

sar0011_4
sar0203_3
sar0050_5
sar2001_1
sar0002_9
And I would like to generate a list ordered by the \d\d\d\d bit in the
middle. I have this from the perl cookbook
my @keys = sort {criterion()} keys(%gene_pool);

but I don't really know how to approach the criterion() function
Use substring to access the parts of the key you want to sort on.
in the spirit of TMTOWTDI

 assuming the letters won't always be the same :

$test=sar0011_4;
(undef,undef,undef,$key)=split(/[A-Za-z]/,$test);
print $key,\n;
 assuming the letters will always be the same:

$test=sar0011_4;
(undef,$key)=split(/sar/,$test);
print $key,\n;
or (still assuming the letters don't change) as has been already 
pointed out, just use sort on the numbers with the letters.

Robin



Re: [OT] backslash when working with Japanese (Re: Pantherbites)

2003-07-25 Thread Robin
On Friday, July 25, 2003, at 03:44 PM, Joel Rees wrote:

I was able to get the backslash in the Project Builder editor in Jaguar
using the option key on the yen key or the forward slash key
I'll vouch for the [option] + [yen] combo.
FWIW [ option] + [ / ] yields a mathematical division sign
Robin





Re: DropScript confusion about cwd

2003-07-12 Thread Robin
On Saturday, July 12, 2003, at 07:30  am, Jeff Lowrey wrote:

AppleScript, on the whole, has a shorter learning time FOR A 
PROGRAMMER to be productive than Perl does.
Given that any language will try to provide the functionality that the 
user culture currently requires of it, all languages have common 
themes. The implemetations of those themes will differ, so yes if 
you're familiar with programming concepts you have a leg up as it were. 
But the questions to ask is do you feel that the time you spend 
grocking AppleScript as it doggedy stretches the 'like English' anology 
to the boundries of patience, is time well spent? I don't, and I 
suspect this reason is precisely why Apple makes sure you have to use 
it for IPC in Acqua rather than leaving a nice programatic interface.



Robin



Re: DropScript confusion about cwd

2003-07-10 Thread Robin
On Sunday, May 11, 2003, at 7:04 AM, John Delacour wrote:

Whatever you can do with DropScript you can do more conveniently with 
Perl in an AppleScript droplet that _does_ know where it is.
On Thursday, July 10, 2003, at 03:37  am, Wilfredo Sánchez wrote:
The assumption that your working directory is where your script lives 
is broken.
Conceptually I have to agree with WIlfredo, but also I agree under old 
MacOS the idea of root was toally nebulous, , so it was necessary to 
check the PWD to get a path to use in scripts, but that was through the 
os dealing with paths behind the scenes.

But if I have to have a double clickable perl script I prefer using the 
'.command' technique because I really believe Apple should just go 
ahead and use Perl as the scripting language and put AppleScript to bed 
along with OS9 - and this coming from someone who built a multiuser 
mailing system with AppleScript, osaxen  and a copy of Eudora back 
around OS7.

Robin


Re: Japanese + Encode::Guess

2003-06-25 Thread Robin
Thanks for your help Dan, but I'm mo further forward, the answer is 
apparently 'ascii', which is puzzling, because but the content is not 
ASCII - it is still legible in a web browser as it was written 
originally so the data is still intact.

I'm guessing that Encode::Guess tests the beginning of the file to see 
what it contains, which being a HTML doc would have characters within 
the ASCII range?



On Wednesday, June 25, 2003, at 02:04  am, Dan Kogai wrote:

print $enc-name;



Japanese + Encode::Guess

2003-06-24 Thread Robin
I'm trying to find out what encoding has been used on a file. It was 
created in a text editor under OS9, but edited also under OSX, the 
scripe below outputs:

Encode::XS=SCALAR(0x94a2c), which when de-reffed is '2421076'

I'm none the wiser.

Robin



#!/usr/bin/perl -w

#=== declare includes =

use strict;
use diagnostics-verbose;
#== declare variables =

my($DataFileName,$LocalPath,$data,$enc,$in,$infile,$out,$outfile);
#= script body 


use Encode;
$LocalPath= $ENV{HOME}.'/Desktop';
$DataFileName='j-indexText.html';
$infile = join ('/',$LocalPath,$DataFileName);
$outfile = join ('.',$infile,parsed);
open (IN, $infile)  or die;
$data=IN;


use Encode::Guess qw/euc-jp shiftjis 7bit-jis /;

$enc = guess_encoding($data, qw/euc-jp shiftjis 7bit-jis MacJapanese 
utf8 /);
ref($enc) or die Can't guess: $enc; # trap error this way

print ${enc};



Getting character Encoding

2003-06-20 Thread Robin
I'm trying to find out what encoding has been used on a file. It was 
created in a text editor under OS9, but edited also under OSX, the 
scripe below outputs:

Encode::XS=SCALAR(0x94a2c), which when de-reffed is '2421076'

I'm none the wiser.

Robin



#!/usr/bin/perl -w

#=== declare includes =

use strict;
use diagnostics-verbose;
#== declare variables =

my($DataFileName,$LocalPath,$data,$enc,$in,$infile,$out,$outfile);
#= script body 


use Encode;
$LocalPath= $ENV{HOME}.'/Desktop';
$DataFileName='j-indexText.html';
$infile = join ('/',$LocalPath,$DataFileName);
$outfile = join ('.',$infile,parsed);
open (IN, $infile)  or die;
$data=IN;


use Encode::Guess qw/euc-jp shiftjis 7bit-jis /;

$enc = guess_encoding($data, qw/euc-jp shiftjis 7bit-jis MacJapanese 
utf8 /);
ref($enc) or die Can't guess: $enc; # trap error this way

print ${enc};



Re: Installing 5.8.0

2003-06-19 Thread Robin
On Friday, June 20, 2003, at 07:23  am, Ken Williams wrote:

On Wednesday, June 18, 2003, at 03:54  PM, Robin wrote:
On Wednesday, June 18, 2003, at 11:34  pm, David R. Morrison wrote:

Has the problem with CPAN overwriting /usr/bin/head with 
/usr/bin/HEAD
been solved?
yes I believe so, thought this is one of the well documented problems 
I was referring to, the other being the LC_ALL environment variable.
I don't think it has been solved.  ExtUtils::MakeMaker still defaults 
to using $Config{installscript} as the install location, and:

  % /usr/bin/perl5.6.0 -V:installscript
  installscript='/usr/bin';
I see in the Changes log a comment that this has been fixed in LWP, 
but I don't see it in the code for libwww-perl-5.69.
I said I thought it was fixed - to be honest I used the workaround of 
making a copy of HEAD and linking it into /usr/bin a goodly while ago - 
and have suffered no ill effects



Problems installing Term::ReadLine::Gnu

2003-06-18 Thread Robin


machine is running OSX cl 10.2.6
perl 5.6 installed as standard
perl 5.8 intsalled under my  /Users/robin/usr/local
installed GNU readline 2.1
I get the errors listed below when trying to install  
Term::ReadLine::Gnu. I can see there are perl DYLD errors which  
suggests 5.6/5.8 conflict, so prseumably I have to alter ./config , but  
don't know what I have to change to get this to work.

TIA

Robin

cpan install Term::ReadLine::Gnu
Running install for module Term::ReadLine::Gnu
Running make for H/HA/HAYASHI/Term-ReadLine-Gnu-1.14.tar.gz
Checksum for  
/Users/robin/.cpan/sources/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu- 
1.14.tar.gz ok
Term-ReadLine-Gnu-1.14
Term-ReadLine-Gnu-1.14/eg
Term-ReadLine-Gnu-1.14/eg/fileman
Term-ReadLine-Gnu-1.14/eg/perlsh
Term-ReadLine-Gnu-1.14/eg/pftp
Term-ReadLine-Gnu-1.14/eg/ptksh+
Term-ReadLine-Gnu-1.14/Gnu
Term-ReadLine-Gnu-1.14/Gnu/euc_jp.pm
Term-ReadLine-Gnu-1.14/Gnu/XS.pm
Term-ReadLine-Gnu-1.14/Gnu.pm
Term-ReadLine-Gnu-1.14/Gnu.xs
Term-ReadLine-Gnu-1.14/INSTALL
Term-ReadLine-Gnu-1.14/Makefile.PL
Term-ReadLine-Gnu-1.14/MANIFEST
Term-ReadLine-Gnu-1.14/ppport.h
Term-ReadLine-Gnu-1.14/README
Term-ReadLine-Gnu-1.14/t
Term-ReadLine-Gnu-1.14/t/button.pl
Term-ReadLine-Gnu-1.14/t/callback.t
Term-ReadLine-Gnu-1.14/t/comptest
Term-ReadLine-Gnu-1.14/t/comptest/0123
Term-ReadLine-Gnu-1.14/t/comptest/012345
Term-ReadLine-Gnu-1.14/t/comptest/023456
Term-ReadLine-Gnu-1.14/t/comptest/a_b
Term-ReadLine-Gnu-1.14/t/comptest/README
Term-ReadLine-Gnu-1.14/t/history.t
Term-ReadLine-Gnu-1.14/t/inputrc
Term-ReadLine-Gnu-1.14/t/readline.t
Term-ReadLine-Gnu-1.14/typemap

CPAN.pm: Going to build H/HA/HAYASHI/Term-ReadLine-Gnu-1.14.tar.gz

Found `/usr/lib/libtermcap.dylib'.
cc  -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing  
-DHAVE_STRING_H rlver.c -o rlver-flat_namespace -lreadline -ltermcap
It seems that you have the GNU Readline Library version 2.1.
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lreadline
Writing Makefile for Term::ReadLine::Gnu
cp Gnu.pm blib/lib/Term/ReadLine/Gnu.pm
cp Gnu/XS.pm blib/lib/Term/ReadLine/Gnu/XS.pm
AutoSplitting blib/lib/Term/ReadLine/Gnu/XS.pm  
(blib/lib/auto/Term/ReadLine/Gnu/XS)
cp Gnu/euc_jp.pm blib/lib/Term/ReadLine/Gnu/euc_jp.pm
/usr/bin/perl /Library/Perl/ExtUtils/xsubpp  -typemap  
/Library/Perl/ExtUtils/typemap -typemap typemap  Gnu.xs  Gnu.xsc  mv  
Gnu.xsc Gnu.c
cc -c   -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3
-DVERSION=\1.14\ -DXS_VERSION=\1.14\  -I/Library/Perl/darwin/CORE  
 -DHAVE_STRING_H -DRL_READLINE_VERSION=0x0201 -DRL_VERSION_MAJOR=2  
-DRL_VERSION_MINOR=1 Gnu.c
In file included from Gnu.xs:715:
Gnu.xs: In function `attempted_completion_function_wrapper':
Gnu.xs:197: warning: passing arg 0 of `xfree' from incompatible pointer  
type
In file included from Gnu.c:1210:
Gnu.xs: In function `XS_Term__ReadLine__Gnu__XS_rl_add_defun':
Gnu.xs:206: warning: passing arg 0 of `dupstr' discards qualifiers from  
pointer target type
In file included from Gnu.c:2017:
Gnu.xs: In function `XS_Term__ReadLine__Gnu__XS_rl_completion_matches':
Gnu.xs:135: warning: passing arg 0 of `rl_completion_matches' discards  
qualifiers from pointer target type
In file included from Gnu.c:2024:
Gnu.xs:135: warning: passing arg 0 of `rl_completion_matches' discards  
qualifiers from pointer target type
In file included from Gnu.c:1682:
Gnu.xs: At top level:
Gnu.xs:206: warning: passing arg 0 of `dupstr' discards qualifiers from  
pointer target type
Running Mkbootstrap for Term::ReadLine::Gnu ()
chmod 644 Gnu.bs
rm -f blib/arch/auto/Term/ReadLine/Gnu/Gnu.bundle
LD_RUN_PATH=/usr/lib cc  -flat_namespace -bundle -undefined suppress  
Gnu.o  -o blib/arch/auto/Term/ReadLine/Gnu/Gnu.bundle   -ltermcap
chmod 755 blib/arch/auto/Term/ReadLine/Gnu/Gnu.bundle
cp Gnu.bs blib/arch/auto/Term/ReadLine/Gnu/Gnu.bs
chmod 644 blib/arch/auto/Term/ReadLine/Gnu/Gnu.bs
Manifying blib/man3/Term::ReadLine::Gnu.3
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e  
test_harness(0, 'blib/lib', 'blib/arch') t/*.t
t/callbackdyld: /usr/bin/perl Undefined symbols:
__rl_restore_prompt
__rl_save_prompt
_add_history
_append_history
_clear_history
_completion_matches
_crlf
_current_history
_ding
_filename_completion_function
_free_undo_list
_funmap
_get_history_event
_history_arg_extract
_history_base
_history_comment_char
_history_expand
_history_expansion_char
_history_get
_history_inhibit_expansion_function
_history_is_stifled
_history_length
_history_no_expand_chars
_history_quotes_inhibit_expansion
_history_search
_history_search_delimiter_chars
_history_search_pos
_history_search_prefix
_history_set_pos
_history_subst_char
_history_tokenize
_history_total_bytes
_history_truncate_file
_max_input_history
_next_history
_previous_history
_read_history_range
_readline
_remove_history
_replace_history_entry
_rl_add_defun
_rl_add_undo
_rl_attempted_completion_function

Re: Installing 5.8.0

2003-06-18 Thread Robin
On Tuesday, June 17, 2003, at 10:23  pm, Lorin Rivers wrote:
What will happen if I use the darwinports perl? Does it automagically 
replace the existing perl in terms of the command line and what not? 
Or would I have to use /opt/bin/perl for 5.8.0 (and just perl for 
5.6)?
The thing you need to be careful of is installing into 
/System/Library/Perl - that would possibly break your system. I tend to 
champion CPAN because it was designed by perlers for perl, rather than 
a generic packaging system which has hundreds of distributions and 
their quirks to track, it's also part of the standard perl 
distribution, which means you have it there on your computer now. The 
whole install process is pretty straightforward as most of the kinks 
have been ironed out and there are documented problems and solutions 
for installing safely on OSX. The other reason I recommend this is you 
know what is on your system because you install it - in the past I used 
fink, which is actually a series of perl modules and started getting 
problems after I upgraded perl coming from the modules installed by 
fink unbeknowst to me.

I'm asking all these questions because I have hosed my perl more than 
once out of ignorance (most people find installing and configuring 
perl a trivial task,
Installing perl (to risk sounding like a troll from CLPM) is not for 
the casual user and as you have already found out it can impare your 
systems functionality if not done correctly. From your post I'm not too 
sure that you actually need to upgrade unless the scripts you want to 
use are trying to use modules which are only available for perl 5.8, or 
sytaxt which is special to perl 5.8. For the most part there is 
backwards compatibility between versions 5.x.

HTH

Robin



Re: Installing 5.8.0

2003-06-18 Thread Robin
On Wednesday, June 18, 2003, at 11:34  pm, David R. Morrison wrote:

Robin [EMAIL PROTECTED] wrote:
upgrades, it belongs to you. Install perl via CPAN as shown also won't
overwrite the perl used by the OSX system itself (perl5.6, kept in
Has the problem with CPAN overwriting /usr/bin/head with /usr/bin/HEAD
been solved?
yes I believe so, thought this is one of the well documented problems I 
was referring to, the other being the LC_ALL environment variable.

cheers

Robin



Re: odd LWP install errors

2003-06-17 Thread Robin
On Saturday, June 14, 2003, at 06:42  pm, Charles Eicher wrote:

Did you ever get a solution to this problem? I'm in exactly the same 
jam. I've hammered on this problem all day. Help!

yes actually I did - for me the problem was with named and netinfo - 
not being a perl problem as such I didn't  post to [EMAIL PROTECTED] 
again - and I'm cross posting into [EMAIL PROTECTED] because I 
furthered my query there.

In my case it was caused by a box which is a nameserver and a NetInfo 
master for it's node on the lan and basically bindd was failing during 
startup due to a delay caused by connectng to the NetInfo master- I 
believe LWP uses the standard Unix way of resolving hostnames and 
IPadresses (gurus feel free to correct any wrong assumptions), so 
localhost couldn't be resolved by LWP, hence the errors. So in short 
named is the culprit.

(ignore the next part if you know how to find out if named is running 
and functioning correctly):

to check if named is running
(in the terminal)
ps -aux | grep named (will show named + grep looking for named if 
running, else will show grep looking for named only)
or
dig google.com (name won't resolve)

to check your machine records and/or kill and start named manually:
(in the terminal)
ps -aux | grep named
sudo kill -HUP namedPID
this will throw up errors in the systemlog telling you where and what 
isn't as it should be.

hth Robin

Re: Perl 5.8 dyld errors with CPAN.pm

2003-06-17 Thread Robin
On Thursday, June 12, 2003, at 12:58  am, Matthew Diephouse wrote:

I hate to beat a dead horse here, but I'm getting some errors from 
CPAN.pm after installing 5.8. I can't redo `make install` because I 
used a package and didn't compile myself. What module is this error 
coming from?
It's coming from all the modules linked into Perl 5.6 - so the core 
modules. 5.8 and 5.6 aren't compatible  - check the archives of this 
list for the same kinds of errors for more info - you will probably 
have to download the source files from CPAN and install manually :
once you decomped the archive:

gzip -dc yourmodule.tar.gz | tar -xof -

add this option to Makefile.pl = 'UNINST=1'

 which tells perl to clean out old modules if you install another 
module with the same name, then run a normal install:

cd /path to/distro
perl Makefile.PL
make
make test
good luck



Re: Installing 5.8.0

2003-06-17 Thread Robin
On Tuesday, June 17, 2003, at 12:24  pm, Sherm Pendley wrote:

On Monday, June 16, 2003, at 10:54 PM, Lorin Rivers wrote:

What is the best, simplest, and easiest approach to having a rock 
solid, reasonably standard perl setup?
If you really and truly need 5.8.0 - and there are some good reasons 
you might, such as improved Unicode support - your best bet would be 
to get it from darwinports.
Dunno I used CPAN.pm and provided you follow the instructons at
http://developer.apple.com/internet/macosx/perl.html
which with the exception of setting the LC_ALL environment variable, is 
pretty concise, it went pretty smoothly.



HTH



Re: CPAN/compilation issues

2003-06-13 Thread Robin
On Thursday, June 12, 2003, at 02:23  am, Christopher D. Lewis wrote:
On Thursday, June 5, 2003, at 09:23  AM, Robin wrote:
* have you installed 5.8 recently?
* do you use fink?
I use perl 5.8 (installed over default install, unfortunately)
that's the problem then - 5.6 and 5.8 have different code bases - you 
need to clear out the 5.6 modules - you can do this with CPAN:
sudo perl -MCPAN -e shell
cpan o conf make_install_arg   UNINST=1
cpan o conf commit

this tells CPAN to uninstall old stuff

from there you can use CPAN to install 5.8

hth

Robin



Re: Learning Perl book, Chapter 1 example: open MAIL, |mail email_address doesn't work

2003-06-08 Thread Robin
On Thursday, June 5, 2003, at 03:36  am, Dan Mills wrote:

On Wed, 2003-06-04 at 03:44, David Cantrell wrote:

To send mail, you need two components.  A mail client (aka a mail user
agent or MUA) and an SMTP program (aka a mail transport agent or 
MTA).  The
'mail' program is an MUA.  It passes messages to a local MTA for 
delivery.
IIRC on OS X the MTA (sendmail) is installed, but not configured, so 
'mail'
successfully hands the message over to sendmail, which then neither 
knows
what to do with it, nor knows how to warn you of the fact.
It's unfortunate that mail exits with 0, however.  I was burned by this
not very long ago (ran M-x mail in emacs for a quick mail, no error,
never got there.  Eventually I ran mailq and realized sendmail wasn't
setup properly).
It isn't mail's fault, though.  sendmail returns with 0 as well.
I've come accross this before, it's a UNIX C-ism which return 0 instead 
- historically any other return value would be an error code, see 
quotes below for clarifiaction

hth

Robin

quotes lifted from unix C programming manpages:

Upon  successful  completion,  getrlimit()  and  setrlimit() return 0. 
Otherwise, these functions return -1 and set errno to indicate the 
error.



The exit function

The argument to exit is a status indication returned to the invoking 
environment.   In the UNIX operating system, a value of 0 is the 
successful return code from a program.   As usage of C has spread 
beyond UNIX, exit(0) has often been retained as an idiom indicating 
successful termination, even on operating systems with different 
systems of return codes.   This usage is thus recognized as standard. 


Re: CPAN/compilation issues

2003-06-06 Thread Robin
On Wednesday, June 4, 2003, at 10:48  am, Christopher D. Lewis wrote:


Any ideas?  What do I need to do to fix this?  What have I likely got 
out of synch?
this looks like you're trying modules compiled for perl 5.6.* with perl 
5.8, check out the archives for DYLD problems, but to give you a couple 
pointers :
* have you installed 5.8 recently?
* do you use fink?

hth

Robin



Re: [MacPerl] Re: problem with Japanese text

2003-03-29 Thread Robin
On Saturday, March 29, 2003, at 10:19  am, Jeff Lowrey wrote:
I don't think we can use 'camel' unless we're willing to admit that we 
also have not evolved to smell good.
and spit when we're unhappy :-)

On Friday, March 28, 2003, at 02:00  am, Nicholas G. Thornton wrote:

 in Japanese you can have different kanji (or groups of kana) that 
spell out the same thing, in so far as pronunciation goes..or you 
want to rewrite all the kanji as kana
English has a couple of variants of this problem - 'queue' and 'cue' 
which sound the same and look the same in IPA and  words like 'record' 
(noun) and 'record' (verb) or 'read' (present) and 'read' (past) which 
by looking the same to a regex.

Of course we use the context to understand the difference when reading 
and there are perl modules which can parse English grammar helping to 
Identify what kind of word you're dealing with

http://new.brians.org/Projects/Technology/Papers/LinkParser/

Having said all that, Japanese usually put the phonetic pronunciation 
(hiragana) with their name and surname (which is usually in kanji) 
which is one situation where the kanji are contextless and it is 
necessary to know the correct pronunciation, I haven't seen yet seen 
software which can do this so in most address book type apps they still 
have to enter both kinds of data manually.



Robin



Re: [MacPerl] Re: problem with Japanese text

2003-03-28 Thread Robin
On Friday, March 28, 2003, at 02:14  pm, Dan Kogai wrote:

On the other hand, counting can be tricky even for natives.  The very 
name of numbers changes depending on what you count.
parallels for this in English can be seen in English group names - a 
gaggle of geese, a troop of monkeys, a knot of toads, a pack of dogs. 
Anyone care to suggest a good one for a group of perl programmers ?  a 
larry, a wall, a camel  . ;-)

In Japanese the very notion of a word is often moot.
Linguistically I tend to look at ASCII words as being like Kanji - a 
combination of symbols to stand for a concept -in English we use 
symbols which were intended to represent the phonetic sound (Great 
Vowel Shift anyone?), while Kanji are combinations of symbols 
representing concepts. So in a way the word 'mentality' is really a 
multibyte character and the kanji for 'kangaikata' stands for the same 
mental idea as the word 'mentality' - what you call the container for 
that packet of data is up to you :-)

Programmatically the encoding delineates how the data can be chunked up 
- ASCII uses whitespace to separate words and a 7 bit envelope per 
character, while EUC-JP uses an 8 bit evelope and Shift-JIS uses a 
'stand on the suitcase while I lock it' system to pack the same 8 bit 
data into a 7 bit envelope (but it was developed my Microsoft). Perl 
was developed by mostly native English speakers, so in text processing 
it takes advantage of recurring patterns of 7 bit ASCII data to 
determine how the data is chunked. And chunked it must be or it is in 
coherent, yet this article:

http://www.perl.com/pub/a/2000/05/cobol.html

talks of a perler meeting a bizarre group of programmers to whom


the idea of variable-length, \n-terminated records was new and strange

implying that data is chunked into fixed length records which aren't 
separated by tokens. Japanese? no COBOL ;-)

Robin



Re: [MacPerl] Re: problem with Japanese text

2003-03-27 Thread Robin
On Thursday, March 27, 2003, at 01:31  am, Chris Nandor wrote:

[EMAIL PROTECTED] (Robin) wrote:
MacPerl per se historically has not been aware of locale outside of
ascii defined ones (not sure about the latest version).
Is there a reason for MacJPerl when MacPerl 5.8.x is released?
 while the 5.8 perl interpreter has built in unicode support, how you 
would go about displaying, editing or even using a perl script 
containing Japanese characters on OS9 (even with the Japanese Language 
kit) is no small task (try a simple regex substitution and you'll see 
what I mean). OSX makes it potentially easier, but most software is 
lagging far behing the promise, still coming in mono lingual mindset 
rather than multilingual, and all that this entails.

Anyway for anyone intersted in more info about the history and 
development of Japanese text encodings, here's a link to one of the 
best pages I found so far on the web:
http://tronweb.super-nova.co.jp/characcodehist.html

Robin



Re: [MacPerl] Re: problem with Japanese text

2003-03-26 Thread Robin
While I realise this is diverging slightly from the original posting, I 
think some background info is useful for dealing with Japanese text. 
There are several text encoding formats - the most widly used being 
ShiftJIS and EUC-JP. Without going into too many details, ShiftJIS 
encoding was created by Microsoft to its usual exacting (lack of) 
standards, which makes it ticklish to deal with, so in the past when 
processing Japanese text, Japanese perlers used a four step conversion 
solution:

(1) input converted from Shift_JIS to EUC_JP
(2) EUC_JP encoded data processed
(3) EUC_JP data converted back to Shift_JIS
(4) output
perl 5.8.0 has built in Unicode support, however the same 4 step 
process is still required for Shift-JIS data

(1) input converted from Shift_JIS to UTF8 (unicode)
(2)  UTF8 encoded data processed
(3) UTF8 data converted back to Shift_JIS
(4) output
MacPerl per se historically has not been aware of locale outside of 
ascii defined ones (not sure about the latest version). Which is why of 
course there is MacJPerl.

http://world.std.com/~habilis/macjperl



HTH

Robin





On Wednesday, March 19, 2003, at 05:58  am, Scott R. Godin wrote:

Jon Reinsch wrote:

I use a simple MacPerl program to archive my email: I save each 
message to
a text file, then run the program to append the messages to a text 
file in
date/time order. Omitting some details, the heart of the program is 
just:

open (inhandle,$infilename))
{
while(inhandle)
{ print $outhandle $_; }
}
My problem is that some of my email contains Japanese text. I'm 
running OS
9.2.1 with the Japanese Language Kit installed. But when Japanese text
goes through the program it comes out as garbage like
bvwirQ[^. Obviously the encoding is being 
lost,
but I don't have the slightest idea how to fix this. Is there a 
module out
there that would provide a simple answer to this problem? Maybe it's 
just
a fantasy, but I'm hoping for something simple like
print $outhandle convertJapaneseText($_);


This might seem very simple but have you looked into

use locale

at all ? try looking at perldoc perllocale for some informative text.

dunno if this will help but it's where my instincts pointed me...




Re: A Wheeler by anyother name...

2003-03-16 Thread Robin
I love these kinds of threads, everything reduced to black and white.
while we're at it,  can anyone suggest
* a good text editor for editing perl scripts?
* a decent OS
* who should be running Apple
* which is the most secure version of Unix
* which is the least secure version of Unix
* why the hunt for Al Qaeda, suddenly became the War on Iraq
* if Slartibartfast ever got to design anything aside from Fjords what 
would he design
* what colour is god?
* which is definitive - creationism or the theory of evolution
* why Apple doesn't make perl the default scripting language for OSX 
(just to keep things on topic)

Actually I know why Punjeet wrote what he did - he was hoping to stir 
up folks into posting as he list was getting a bit too quiet. Like my 
query about bit level editing didn't even get 1 reply - where were you 
all then, huh? :-)



accessing file contents at byte level

2003-03-12 Thread Robin
I'm looking at ways of shredding files using perl so I have a couple of 
questions, I hope someone can help me out as I haven't been able to 
find any info specific enough in this regard:

1) is inplace editing to be similar to unlink - ie the system removes 
the indexing which connects the filename to the area(s) it occupies on 
disk, as in:

make (new.file);
rename (old.file, new.file);
thereby leaving the old data on disk but freeing up the area on disk 
for writing

2) assuming point (1) to be true, are sysread() and syswrite() the best 
candidates for accessing the file contents on disk directly?



TIA

Robin





Re: MacPerl-Perl help

2003-03-11 Thread Robin
On Wednesday, March 5, 2003, at 04:09  pm, Nicholas G. Thornton wrote:

 As I recall you can run a script from the commandline via a
command something like this:
perl file.plx (@ARGV)
But whenever I try this nothing happens.
you need to give the path so that the perl interpreter can find the 
file. If it's on the desktop, that would be

/Users/YOUR SHORT LOGINNAME/Desktop/file.pl (the short login would be 
the user name you see in the terminal)

Note, unlike the terminal,  for perl the path is CaSe SenSitiVe. 
Alternatively just dragging the file onto the terminal will print the 
path in the terminal.

Also check the shebang actually matches the location of the perl 
interpreter, mine is

'#!/usr/bin/perl'

check the path by typing
which perl
or
whereis perl
in the terminal


Using *.command the file still opens the file in BBEdit rather than 
running it
in a new terminal window for me.
check that the file owner is the terminal (in the finder [apple] + [i]) 
and not BBedit

HTH

Robin



Re: perl: warning: Setting locale failed.

2003-03-10 Thread Robin
On Monday, March 10, 2003, at 08:12  am, Vicki Brown wrote:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = en
are supported and installed on your system.
perl: warning: Falling back to the standard locale (C).
perlocale touches on this, it's a known issue for OSX. Concrete  
solutions along with explanations as to what is happening here:

http://www.omnigroup.com/mailman/archive/macosx-admin/2002-September/ 
025590.html

HTH

Robin



Re: perl: warning: Setting locale failed.

2003-03-10 Thread Robin
On Monday, March 10, 2003, at 11:16  am, Kay Roepke wrote:
Probably the quickest is to tell Perl to shut up about it, by setting 
the PERL_BADLANG environment variable to 0.
however this will adversley affect standard functions which use 
matching or comparison capabilities (not just regex), though not life 
threatening, it does introduce weaknesses which could be exploited, 
this is also covered in perllocale.

Of course the *proper* way of doing this involves your suggestion 
fixing the locale files. A lot of darwin users would be obliged to you 
;-)
Technically you could do this yourself

man mklocale

but I haven't had the courage to try this for fear of  breaking 
something which relies on the way the system behaves at present. Or 
maybe I'm being too generous to Apple.

Robin



Re: setenv LANG in v5.8

2003-02-06 Thread Robin

On Wednesday, February 5, 2003, at 08:51 AM, Pavel Stranak wrote:

Perl 5.6 works fine with ANY LC_ALL and any LANG in the same shell.  
How is it possible?


having gone through this problem a while back, and piecing the jigsaw  
together  I surmised that
Apple does some compile time magic to get these two global variables to  
set.

Setting these as shell environment variables works as long as you run  
your scripts under a shell - scripts run as cron jobs will start  
complaining becase they use the system wide environment. How to solve  
this problem along with a perl script which does it all for you can be  
found in the archives of this list:
http://www.omnigroup.com/mailman/archive/macosx-admin/2002-September/ 
025590.html under the seach friendly subject Locale setting errors -  
LC_ALL, LANG

I would further add that perl complains if you don't set LC_ALL to C  
because not all locale issues are connected to text processing, a lot  
of numeric functions depend on locale - so unless you wish to use say  
roman numerals instead of decimals, you shouldn't have any real need  
for any other locale definition beyond the standard C library. LANG you  
can set to whatever you wish I believe*, as this aids perl in its text  
processing abilities, though I haven't tried setting this to anything  
other than English.


* provided it is an existising local definition


HTH

Robin








Re: setenv LANG in v5.8

2003-02-06 Thread Robin

On Wednesday, February 5, 2003, at 08:51 AM, Pavel Stranak wrote:

Perl 5.6 works fine with ANY LC_ALL and any LANG in the same shell.  
How is it possible?


having gone through this problem a while back, and piecing the jigsaw  
together  I surmised that
Apple does some compile time magic to get these two global variables to  
set.

Setting these as shell environment variables works as long as you run  
your scripts under a shell - scripts run as cron jobs will start  
complaining becase they use the system wide environment. How to solve  
this problem along with a perl script which does it all for you can be  
found in the archives of this list:
http://www.omnigroup.com/mailman/archive/macosx-admin/2002-September/ 
025590.html under the seach friendly subject Locale setting errors -  
LC_ALL, LANG

I would further add that perl complains if you don't set LC_ALL to C  
because not all locale issues are connected to text processing, a lot  
of numeric functions depend on locale - so unless you wish to use say  
roman numerals instead of decimals, you shouldn't have any real need  
for any other locale definition beyond the standard C library. LANG you  
can set to whatever you wish I believe*, as this aids perl in its text  
processing abilities, though I haven't tried setting this to anything  
other than English.


* provided it is an existising locale definition


HTH

Robin



Re: Another Perl 5.8 Problem

2003-01-15 Thread Robin

On Wednesday, January 15, 2003, at 03:36 PM, Jens-Christoph Brendel 
wrote:

I hope I don't getting on your nerves,

no don't worry you're looking for a solution, been there meself. But 
maybe we're talking about different errors - the solution I'm offering 
is for the following error:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = de
are supported and installed on your system.
perl: warning: Falling back to the standard locale (C).

This is perl, v5.8.0 built for darwin-thread-multi 

This still being the case the error is thrown up because LC_ALL, the 
default locale, is not set

 but your explanation do not fit to my observations. Before I set 
LC_LANG=C in the environment.plist I got the mentioned error message 
by example after I entered perl -v in a terminal window by example.
that sounds correct - the default locale for perl isn't set - perl 
complains

There is no 'use locale' pragma but perl didn't ignored the LANG=de 
setting in my shell environment.

presumably you ran this in the shell which would also be consistent - 
the shell adds the missing ENV variable for LANG, but you didn't get 
the shell to set LC_ALL=C

With these settings (LC_ALL unset, LANG=de in the shell environment)

and this is the point I believe you're missing - LC_ALL must be set to 
C or perl complains. Have you tried setting it?
The whole of the locale machinery is built around the fact this 
constant will be there and that is what the (above) warning is saying:

I can't find a value for LC_ALL  but so you can get pattern matching 
and comparisions of data I'm defaulting to the C locale anyway, you 
might want to check into things your end

HTH

Robin



Re: Another Perl 5.8 Problem

2003-01-14 Thread Robin
that particular warning can be found in the archives of this mailing 
list along with explanations on what the various solutions offered here 
do, why you're getting the error in the first place and a perl script 
that does all the right stuff under the hood for you so you will get it 
no more no matter how you choose to use your comp


On Monday, January 13, 2003, at 04:13 AM, Jens-Christoph Brendel wrote:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = de
are supported and installed on your system.
perl: warning: Falling back to the standard locale (C).

This is perl, v5.8.0 built for darwin-thread-multi
...

(Perl was built with locale support:

bash-2.05a$  perl -V:d_setlocale
 ...
d_setlocale='define' ).


I tried to figure out what happens using ktrace and found, that perl 
tries to read a file /usr/share/locale/de/LC_COLLATE. But there is no 
such file (in none of the locale directories). I would it build by 
myself, but I'm not sure if it must be a binary file (like LC_TYPE). 
mklocale on the other hand will only translate LC_TYPE-files.

I looked around and searched for a solution in several Darwin and 
MacOS X sites, but without success.

Does anyone know how to build the missing locale? Any hints are highly 
appreciated.

Jens-Christoph Brendel





Re: CPAN Failure after install of 5.8.0

2003-01-14 Thread Robin
to put it in a nut shell:
5.6 and 5.8 are not binary compatible. There for anything which was 
compiled for 5.6 will not work for 5.8. Or to put it another way, you 
will have to download and re- compile any modules which exhibit odd 
behaviour under 5.8.


hth

Robin




On Tuesday, January 14, 2003, at 08:51 AM, Kime H. Smith, Jr. wrote:


Thanks for the response, Chad (Clark).

I finally got by the CPAN problem by deleting /Library/Perl and doing 
another make Install of Perl --

Now I'm stuck on the DBI install. Even with a force install 
Bundle::DBI  or force install DBI, I get an error:

Running install for module DBI
Running make for T/TI/TIMB/DBI-1.32.tar.gz
Checksum for 
/Users/khsmith/.cpan/sources/authors/id/T/TI/TIMB/DBI-1.32.tar.gz ok
DBI-1.32
DBI-1.32/t
DBI-1.32/t/06attrs.t
.
.
.
cp Changes blib/lib/DBI/Changes.pm
make: *** No rule to make target `blib/arch/auto/DBI/Driver.xst', 
needed by `Perl.xsi'.  Stop.
.
.
.
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm
  /usr/bin/make -j3 -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible



Should I delete ...cpan/sources/authors/...DBI-1.32.tar.gz??

Any suggestions would be greatly appreciated.

Thanks in advance,
Kime

On Monday, January 13, 2003, at 03:26 PM, Chad A. Clark wrote:

On 1/13/03 2:39 PM, in article
[EMAIL PROTECTED], Kime H. 
Smith
[EMAIL PROTECTED] wrote:

After doing a fresh install of Perl 5.8.0 following the directions on
developer.apple.com (
http://developer.apple.com/internet/macosx/perl.html) I ran into 
the
following at the end of the CPAN config. I'm using Jaguar 10.2.3 
Server
on an Xserve.

khsmith% sudo perl -MCPAN -eshell
dyld: perl Undefined symbols:
_Perl_sv_2pv
_perl_get_sv
Trace/BPT trap

.. and CPAN dies. I need to install support for MySQL.

Things went fine installing using the same procedure on my TiBook
(Jaguar 10.2.3).

Please advise!

snipped from perldelta.pod from 5.8.0


snip
Mac OS X dyld undefined symbols

If after installing Perl 5.8.0 you are getting warnings about missing
symbols, for example

dyld: perl Undefined symbols
_perl_sv_2pv
_perl_get_sv

you probably have an old pre-Perl-5.8.0 installation (or parts of one)
in /Library/Perl (the undefined symbols used to exist in pre-5.8.0 
Perls).
It seems that for some reason make install doesn't always completely
overwrite the files in /Library/Perl.  You can move the old Perl
shared library out of the way like this:

cd /Library/Perl/darwin/CORE
mv libperl.dylib libperlold.dylib

and then reissue make install.  Note that the above of course is
extremely disruptive for anything using the /usr/local/bin/perl.
If that doesn't help, you may have to try removing all the .bundle
files from beneath /Library/Perl, and again make install-ing.
/snip

Or alternatively,

find /Library/Perl -name '*.bundle' -print | xargs rm -I

I had to install DBI and DBD::MySQL by force CPAN build fails.

--
Chad A. Clark






Re: Another Perl 5.8 Problem

2003-01-14 Thread Robin
oops! forgot to include the URL

http:[EMAIL PROTECTED]/msg03130.html

On Tuesday, January 14, 2003, at 09:53 PM, Robin wrote:


that particular warning can be found in the archives of this mailing 
list 




Re: Another Perl 5.8 Problem

2003-01-14 Thread Robin

On Wednesday, January 15, 2003, at 04:26 AM, Jens-Christoph Brendel 
wrote:

. The problem remains that with this method only the  C locale 
can be set correctly.  Files for certain parts of a complete  locale 
definition (e.g. LC_COLLATE) are missing. Perl looks for LC_COLLATE 
and shows the cited error message just because this can't be found. 
It's therefore impossible to use other language specific locales than 
C (for example de_DE as I tried).

Assuming that the errors you mention are the same as your original 
post, you don't need to compile locales. On OSX the locales are stored 
in /usr/share/locale, this is what I get when I type 'ls 
/usr/share/locale':

C   en_GB.ISO8859-15hr_HR.ISO8859-2 no
be  en_GB.US-ASCII  hu_HU.ISO8859-2 no_NO
bg_BG.CP1251en_US   is_IS   
no_NO.ISO8859-1
cs  en_US.ISO8859-1 is_IS.ISO8859-1 
no_NO.ISO8859-15
cs_CZ.ISO8859-2 en_US.ISO8859-15is_IS.ISO8859-15pl
da  en_US.US-ASCII  it  
pl_PL.ISO8859-2
da_DK   eo  it_CH   pt
da_DK.ISO8859-1 es  it_CH.ISO8859-1 pt_PT
da_DK.ISO8859-15es_ES   it_CH.ISO8859-15
pt_PT.ISO8859-1
de  es_ES.ISO8859-1 it_IT   
pt_PT.ISO8859-15
de_AT   es_ES.ISO8859-15it_IT.ISO8859-1 ru
de_AT.ISO8859-1 fi  it_IT.ISO8859-15ru_RU.CP866
de_AT.ISO8859-15fi_FI   ja  
ru_RU.ISO8859-5
de_CH   fi_FI.ISO8859-1 ja_JP.EUC   ru_RU.KOI8-R
de_CH.ISO8859-1 fi_FI.ISO8859-15ja_JP.SJIS  ru_RU.cp1251
de_CH.ISO8859-15fr  ko  ru_RU.koi8r
de_DE   fr_BE   ko_KR.EUC   sl
de_DE.ISO8859-1 fr_BE.ISO8859-1 la_LN.ISO8859-1 
sl_SI.ISO8859-2
de_DE.ISO8859-15fr_BE.ISO8859-15la_LN.ISO8859-15sv
en  fr_CA   la_LN.ISO8859-2 sv_SE
en_AU   fr_CA.ISO8859-1 la_LN.ISO8859-4 
sv_SE.ISO8859-1
en_AU.ISO8859-1 fr_CA.ISO8859-15la_LN.US-ASCII  
sv_SE.ISO8859-15
en_AU.ISO8859-15fr_CH   lt_LT.ISO8859-4 uk
en_AU.US-ASCII  fr_CH.ISO8859-1 nl  uk_UA.KOI8-U
en_CA   fr_CH.ISO8859-15nl_BE   uk_UA.cp1251
en_CA.ISO8859-1 fr_FR   nl_BE.ISO8859-1 zh_CN
en_CA.ISO8859-15fr_FR.ISO8859-1 nl_BE.ISO8859-15zh_CN.EUC
en_CA.US-ASCII  fr_FR.ISO8859-15nl_NL   zh_TW
en_GB   he  nl_NL.ISO8859-1 zh_TW.Big5
en_GB.ISO8859-1 hr  nl_NL.ISO8859-15


from Perllocale - numbers added by me
[1] By default, Perl ignores the current locale.  The  `use locale' 
pragma tells Perl to use the current locale for some operations:
...
[2] In the scope of `use locale', Perl looks to the `LC_COLLATE' 
environment variable to determine the application's notions on 
collation (ordering) of characters.
/from Perllocale

so in [1] it's saying reguardless of what locale you use outside perl, 
unless you tell perl otherwise, it uses the LC_ALL='C' locale.
[2] when you try to 'use locale ', perl looks for an Environment 
variable called LC_COLLATE

So the solution is to set any Environment variables perl complains 
about, and their values, into the system.plist (which is global, unlike 
the alternative of setting them in a terminal startup file), by hand, 
with the Dev Tools Plist Editor or the perl script (duly modified to 
match your needs ) from the post at 
http:[EMAIL PROTECTED]/msg03130.html, as you 
prefer.

It wouldn't hurt to read through perllocale too :-)


HTH

Robin

execable perl scripts puzzle

2002-10-07 Thread Robin


I'm trying to get perl scripts to run without having to go into the 
terminal or use a wrapper app.

The script menu promises to be able to run any script from shell or 
perl to AppleScript.

I've read that adding .command to a script name make scripts become 
double clickable processes running in the terminal.

Neither seem to work for me - I have a perl script which I 'chmod'ed to 
make execable, and saved as script_name.command. Using wither of the 
above methods simply opens it in TextEdit, so I  presume I'm missing 
something vital (and yes I tried logging out and in to reset the 
environment variables).


Robin




Re: execable perl scripts puzzle - solved

2002-10-07 Thread Robin

I guess this is what comes of expecting things to be more complicated 
than they actually are :-)

 At 18:38 Uhr +0900 07.10.2002, Robin wrote:
 saved as script_name.command... .opens it in TextEdit,

On Monday, October 7, 2002, at 09:25 PM, John Delacour wrote:
 If you change the extension of junk.pl you've just created to .command 
 and double-click it, it will launch the Terminal and the script will 
 run.
This is what I'd read but it doesn't work for me- it opens the script 
in the applicaton used to create it


On Monday, October 7, 2002, at 09:15 PM, Rafael K. Kobylinski wrote:
 Check the file info dialog - maybe the real extension is .txt and is 
 set to be not visible, maybe the preferred application gets into the 
 way. The .command extension works for me.
Oddly enough I hadn't checked this - OSX appears to use the file 
extension for a lot of stuff - the file extension was correct, however 
I needed to change the application to terninal.app.

On Monday, October 7, 2002, at 09:25 PM, John Delacour wrote:
 Rather a clunky way to do things.  A neater way would be so use 
 AppleScript or a shell script.   Terminal does not need to be invoked 
 or running.
that's true but I know perl and I haven't used AppleScript since around 
OS 7  so until I can figure out how to write an AppleScript wrapper for 
perl this'll have to do :-)-
however as the script in question outputs to the clipboard I don't 
actually get a terminal window opening.

Robin




Re: Perl 5.8.0 on MacOS X 10.2.1 Server (problems)

2002-10-03 Thread Robin

I had the same problem after installing  5.8.0 but luckily for me Brian 
McNett got nailed by this before me and figured out a solution.

Brian also mentions the fact he looked in perldelta  (perldoc 
perldelta), and to be honest it woud never have occurred to me to look 
for answers there if I hadn't read it in his posting, perldeta mentions 
this problem twice:


perldelta: Known Problems

 Perl_get_sv

 You may get errors like 'Undefined symbol Perl_get_sv' or can't 
 resolve symbol 'Perl_get_sv', or the symbol may be Perl_sv_2pv.  
 This probably means that you are trying to use an older shared Perl 
 library (or extensions linked with such) with Perl 5.8.0 executable.  
 Perl used to have such a subroutine, but that is no more the case.  
 Check your shared library path, and any shared Perl libraries in those 
 directories.

 Sometimes this problem may also indicate a partial Perl 5.8.0 
 installation, see Mac OS X dyld undefined symbols for an example and 
 how to deal with it.


perldelta:Platform specific problems
 OSX


 If after installing Perl 5.8.0 you are getting warnings about missing 
 symbols, for example

dyld: perl Undefined symbols
_perl_sv_2pv
_perl_get_sv

 you probably have an old pre-Perl-5.8.0 installation (or parts of one) 
 in /Library/Perl (the undefined symbols used to exist in pre-5.8.0 
 Perls).  It seems that for some reason make install doesn't always 
 completely overwrite the files in /Library/Perl.  You can move the old 
 Perl shared library out of the way like this:

cd /Library/Perl/darwin/CORE
mv libperl.dylib libperlold.dylib

 and then reissue make install.  Note that the above of course is 
 extremely disruptive for anything using the /usr/local/bin/perl.  If 
 that doesn't help, you may have to try removing all the .bundle files 
 from beneath /Library/Perl, and again make install-ing.


I had the second scenario (ie bundles) and so did Brian McNett

On Wednesday, September 25, 2002, at 07:46 AM, Brian McNett wrote:

% find . -name *.bundle | xargs sudo rm -f
% cd ../../usr/local/src
% sudo make install

then test it:

% perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.61)
ReadLine support enabled

cpan


 On Thursday, October 3, 2002, at 10:09 PM, Thomas von Eyben wrote:

 I have just fallen into the same trap (I think). I installed Perl 
 5.8.0 on a Mac OS X 10.2.1 Server(!) fo


HTH Robin




Re: question on ssh and peeve on editors

2002-10-03 Thread Robin




wht not copy the files back and forth with perl:

use LWP::Simple;

$flag = mirror($RemotePath,$LocalPath);

print $flag,\n;
}


On Friday, October 4, 2002, at 03:20 AM, Andrew Brosnan wrote:

 On 10/3/02 at 1:12 PM, [EMAIL PROTECTED] (Puneet Kishor) wrote:

 I want to edit perl scripts
 You can mount a remote server on your desktop via Samba:

 Finder Go Menu - Connect to server (or Cmd K)
 In address type (I think) smb://www.hostname.com/username

 -or-

 Using BBEdit choose File - Open from FTP Server




Re: 10.2 + 5.8 CPAN trouble

2002-10-02 Thread Robin

You don't need to re-install CPAN, just re-configure it -

So in the terminal type:
1) [terminal commandline:]user% cd ~
2) [terminal commandline:~]user% sudo mkdir .cpan
3) [terminal commandline:~]user% cd ~/.cpan
4) [terminal commandline:~/.cpan]user% sudo mkdir build
5) [terminal commandline:~/.cpan]user% sudo mkdir sources
6) [terminal commandline:~/.cpan]user% sudo perl -MCPAN -e shell
cpano conf


What you wrote:
1) makes sure you're in your userfolder
2) makes a folder called '.cpan' which is the default install name
3) moves you into the new .cpan dir
4) makes a folder called 'build', used by cpan
5) makes a folder called 'sources', used by cpan
6) will list the current CPAN configuration

to change the config data so that CPAN can see and use the folders you 
made, still from the command line



EITHER:
i)  cpano conf cpan_home =  /User/YOUR USERNAME/cpan
ii)  cpano conf build_dir= /User/YOUR USERNAME/cpan/build
iii) cpano conf keep_source_where= /User/YOUR USERNAME/cpan/sources
iv) cpan o conf commit  (save changes to the config info)

What you wrote:
i)sets the cpan folder to /User/YOUR USERNAME/cpan
ii)   sets the new  build_dir
iii)  sets the source dir
iv)  saves changes tyou just made



OR :
cpan o conf init

which will run the script which asked you for the config info the first 
time you ran CPAN



In the terminal type perldoc cpan  for more information about  CPAN.


HTH

Robin

On Wednesday, October 2, 2002, at 09:53 PM, Richard Jolly wrote:
 tar: Failed open to read on 
 y/sources/authors/id/A/AN/ANDK/CPAN-1.63.tar.gz No such file or 
 directory
 Couldn't opendir y/build/ANDK000: No such file or directory at 
 /Library/Perl/CPAN.pm line 4873

 I'm not sure what to do next. I've excerpted quite a lot from my 
 terminal below - hopefully this will be clear to someone with more 
 experience.





Re: 10.2 + 5.8 CPAN trouble

2002-10-02 Thread Robin


On Thursday, October 3, 2002, at 12:06 AM, Richard Jolly wrote:

 Why is it such a bad idea to replace Apple's 5.6? I could reinstall 
 10.2 just to revert that, I guess. Would it be worth it?

in short perl 5.6.1 is not the same code base as 5.8- so any modules 
whch were ompiled to run with 5.6.1 won't work with 5.8.0.
This is a problem when you overwrite the default install of perl because 
many OSX system tasks use perl scripts, which suddenly can't use perl. 
This equates to OSX fubar :-)




Parsing JIS X 0208 Shift JIS with 5.8.0

2002-10-01 Thread Robin

Is anyone else doing/done this? Care to share notes?


Robin




Re: Parsing JIS X 0208 Shift JIS with 5.8.0

2002-10-01 Thread Robin
First off - I didn't post specifics because I wasn't sure that it might 
be of interest to the OSX perl comunity as a whole, I hoped to get the 
interested parties emailing me privately, but then again the total 
scarcity of docs (that I could find in English) regarding this topic on 
the net, means it  probably merits public posting.

On Tuesday, October 1, 2002, at 06:47 PM, Dan Kogai wrote:
 just perldoc Encode  perldoc Encode::JP.

Dan, I know you are one of the driving forces behind the unicode side 
of perl 5.8.0, hats off to you man (sincerly), I got as far as perldoc 
Encode but haven't yet got to Encode::JP - there's a lot to read.

My basic problem is I don't have any fast n' hard examples to go by 
which I can apply to the situation where I find myself now which is:

*parse a collection of ASCII docs mixed in with docs in iso-2022-jp, 
shiftjis and possibly 7bit-jis, (by which I mean each doc could be 1 of 
three encodings, not 1 doc a mixture of all three).
*parse for tokens (Kanji charcters - ie neither Hiragana or Katakana)
*do regex substitutions accordingly

The unicode site however unicode apparently lumps kanji in with 
Chinese, which is understandable but not helpful as I need specific 
code points for specific Kanji characters ie  '$B7n(B' which are featured in 
U3200.pdf but as glyphs combined with the number ie codes 32C1 - 32CB.

Then, as my own intutition was drawing blanks,  I thought perhaps I 
should ask if anyone else has some pointers which led to my original 
posting.

Pointers anyone ^_^?


Fwd: Proper channels ... Re: OT: MacAngst

2002-10-01 Thread Robin



Begin forwarded message:

 From: Matt Johnston [EMAIL PROTECTED]
 Date: Tue Oct 1, 2002  1:16:11 AM Asia/Tokyo
 To: Mac Admin [EMAIL PROTECTED]
 Subject: Proper channels ...  Re: OT: MacAngst


 On Monday, Sep 30, 2002, at 12:57 Europe/London, Robin wrote:

 On Monday, September 30, 2002, at 11:27 AM, Bill Stephenson wrote:
 Provide some detail and we'll try to help... If your only goal is to 
 express extreme displeasure over MacOS X, I don't know where to 
 (officially) do that either.
 though quite a few of us hope that Apple is monotoring mailing lists 
 like these when there are things we don't like about OSX :-)

 I don't see why Apple should monitor anything other than their 
 official lists (and yes, they have their own). They also have support 
 forums which are for bug reports, support requests and suggestions and 
 not, as some people think, for people to just express their 
 displeasure (which is the reason why they remove so many posts).

 For that sort of thing we have /.

 M

 --
 Eve succumbed to the temptation of the Apple.

 ___
 MacOSX-admin mailing list
 [EMAIL PROTECTED]
 http://www.omnigroup.com/mailman/listinfo/macosx-admin





Re: OT: MacAngst

2002-09-30 Thread Robin


On Monday, September 30, 2002, at 11:27 AM, Bill Stephenson wrote:
 Edward Lewis [EMAIL PROTECTED]wrote:
 Is there someplace to express extreme displeasure over MacOS X?

 Provide some detail and we'll try to help... If your only goal is to
 express extreme displeasure over MacOS X, I don't know where to
 (officially) do that either.

though quite a few of us hope that Apple is monotoring mailing lists 
like these when there are things we don't like about OSX :-)



Re: OS X Smokers

2002-09-30 Thread Robin


perl.org quoth:
The smokers does smoke tests of the bleading edge Perl on various 
platforms to help the developers spot new bugs as fast as possibly.

man sounds like a world of pain..




Re: request: dyld explained

2002-09-24 Thread Robin

This error might be connected with your lib paths - namely if you've 
installed a newer version of perl. Due to the basic animosity between 
5.6.* and 5.8.0, if you've installed 5.8.0 it doesn't like mods compiled 
with 5.6.*

You may need to re install the mods concerned.

HTH

Robin


On Wednesday, September 25, 2002, at 05:31  am, Jonathan King wrote:


 On Tue, 24 Sep 2002, allan wrote:

  Text::Iconv...dyld: perl Undefined symbols:
  _libiconv
  _libiconv_close
  _libiconv_open

 OK, so this is the exact error I'm getting with libiconv when trying
 to install Axpoint...with the additional annoyance that I've
 *installed* libiconv. :-(




Re: mysqldump perl script via crontab problems

2002-09-23 Thread Robin


On Sunday, September 22, 2002, at 12:30  pm, douglas mcdonald wrote:

 I'm having a problem running a backup script through cron. The script 
 runs perfectly from the command line, but when I run it through cron I 
 end up with an empty file. This is presumably because the mysqldump 
 is not recognized as a sh command (which it's not, understandably).

  What I need is a way to access the mysqldump app through crontab.

if it's an app then that translates to a process for perl so you can 
open pipes ('|') in or out to the process pretty much the way you open 
input or output flows:

#!/usr/bin/perl -w

## this script copies today's date to and from the clipboard ##

use strict;

my(temp,$temp,$date);
open (CLIPBOARDOUT, |pbcopy);
temp=(localtime (time));
print CLIPBOARDOUT sprintf  (%02d/%02d/%02d, $temp[3], ($temp[4]+1), 
($temp[5]%100));
close (CLIPBOARDOUT);

open (CLIPBOARDIN, pbpaste|);
$date =CLIPBOARDIN;

print \$date is: ,$date,\n;int CLIPBOARD sprintf  (%02d/%02d/%02d, 
$temp[3], ($temp[4]+1), ($temp[5]%100));

here the perl script sends the data to the process which manages the 
clipboard.

How ever if the app isn't running when you call for it, then obviously 
you aren't going to get what you expect.

Also I suggest you check for return values which might give you some 
idea as to what's going wrong:

#!/usr/bin/perl-w

($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = 
localtime();
$mon++;
$year += 1900;
$date = dbname_${year}_${mon}_${mday}_${min};
$flag= `mysqldump -umysqluser -pmysqlpassword --flush-logs --lock-tables 
--databases dbname  /library/webserver/data/$date.sql`;
open (OUT,/path/to/log)||die $!;
print OUT  \$flag is=,$flag,\n;




Re: Standardfile ?

2002-09-23 Thread Robin


On Tuesday, September 24, 2002, at 02:03  am, zampino wrote:

 On MacPerl/OS9 I used to include via require a module called 
 StandardFile.pl
 that allowed my programs to call the Mac OS open and close file dialog 
 box.
 Is there an equivalent under OSX?

Basically no. At least not yet - the deal is anything which used calls 
to the toolbox in OS9 won't work under OSX, however some interested 
parties are working on porting some of the functionalities.
Or there's camel bones (http://camelbones.sourceforge.net/)if you can't 
wait and want to roll your own.

HTH

Robin




Re: OS Poll

2002-09-23 Thread Robin


On Tuesday, September 24, 2002, at 09:53  am, Ric Phillips wrote:
 MS, though  not makers of hardware - to any great extent -
Can you name 1 computer actually made by Microsoft, ever? Or are you 
talking about joysticks?

 Hardware may or may not be an essential part of a platform. Oracles, 
 Sun, and SAP are also 'platform' vendors - in different market sectors.
and you're saying people who buy a Sun computer are consider the OS 
before the hardware?
Do you consider the merits of the stereo system and/or paint job of a 
car before you buy it?

 This is a new platform - not simply an extension of the old Apple 
 platform.
You're right it's an extension of the Next platform, mixed with FreeBSD. 
There's virtually nothing left of the old Mac OS except the name.

 My 'guess' is that most PERL hackers would most likely be living in the
 'colonies' of Apple's current platform.
Which colony, in which Empire, on which planet are you living in?You do 
know that this is a 'PERL' list don't you?

 If you are one of these frontiersmen, you are most definitely NOT the 
 person the
 current Apple 'platform' was conceived and developed for.
I think you should go and have a look at the apple website - like any 
company, Apple doesn't care who buys its products or for what, just as 
long as they sell, and to aid this they have put lots of small 
enducements into OSX - like why it can have more Windows like behaviour 
for users or network easily with a windows network, or comes with a unix 
disk formatting option and optional unix networking styles, or display 
more Mac like features - hidden internals, no technical knowledge 
required to use programs and no command line with cryptic commands.

But at the end of the day people buy OSX because they need a new 
computer.




Re: OS Poll

2002-09-23 Thread Robin


On Tuesday, September 24, 2002, at 02:15  pm, Justin Simoni wrote:

 Can you name 1 computer actually made by Microsoft, ever?

 Xbox.


email this from your Xbox did you :-)




Re: lost path settings and funky cpan

2002-09-22 Thread Robin


On Monday, September 23, 2002, at 02:08  pm, Puneet Kishor wrote:


 2. cpan did something strange -- I fired up cpan and it promptly 
 reminded me that I should upgrade cpan itself as well as libnet. I 
 dutifully upgraded cpan to 1.63 and reloaded, and then asked it to 
 upgrade libnet. Lo and behold... I see cpan is trying to download 11 Mb 
 of Perl 5.8.0,

This was something I got nailed by when 5.6.1 came out - it's to do with 
the latest CPAN  'require'ing the latest version of perl - as I remember 
CPAN won't install perl unless you go through the configure, make, make 
test, install sequence (which require a minimum of user input), however 
it will try to download perl everytime you run it. Annoying but not that 
harmful unless you're short on disk space.

Have you looked on the CPAN web site to see if you can get an older copy 
of CPAN bundle?

Robin




Locale setting errors - LC_ALL, LANG

2002-09-20 Thread Robin

This was _really_ annoying me to the point of burning effigies of 
camels, so with a view to helping any other unwary souls -

Problem:
After rolling your own installation of perl , when you try to run a perl 
script you get a variation on the following:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = En_US,
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale (C).

Several places on the internet, including the ADC section of the apple 
web site, suggest creating a .tcshrc or .bash file containing the 
missing variables. This is only a partial solution however, working only 
if you run the script from a terminal window (aka CLI) - perl scripts 
run as standalones, cron jobs and so on, still throw up locale errors 
because the system environment doesn't have the necessary variable(s) set

The solution?

I got the answer thanks to this page by Bob Dalgleish
http://duke.usask.ca/~dalglb/macosx/Perl_5.6.html

where it gives an example of a shell script which makes an 
environment.plist containing the missing locale variable(s).

I've turned it into a perl script (written for clarity rather than 
compactness) with some extra features which I think might be useful 
(like the ability to change the language locale).


==SCRIPT STARTS BELOW THIS TEXT==
#!/usr/bin/perl -w

# Locale WTK(water torture killer).pl
# Author Robin McFarlane [EMAIL PROTECTED]
#
# based on the shell script written by by Bob Dalgleish
# viewable at http://duke.usask.ca/~dalglb/macosx/Perl_5.6.html
#
# This script will look for any missing folders and files in your user 
folder,
# needed to kill locale related errors, creating them as need be.
#
# It will also safely add missing locale info to an existing 
environment.plist,
# making a back-up of the original called environment.plist.old in the 
same folder.



#=== declare includes =

use strict;
use diagnostics-verbose;


#== declare variables =

my ($TempPath,$path,$flag,$dir,$Missing1,$Missing2);
my (@NewPlist,@OldPlist,@Template,$TempFile,$plist);
my (%DataCheck,$ChangeFlag);

$path=join ('/', '/Users',$ENV{USER});
$dir ='.MacOSX';
$plist='environment.plist';
@Template=DATA;

print Checking your current environment set up\n;

$TempPath= join ('/',$path,$dir);
if (-e $TempPath){
print \t,$TempPath, exists\n;
}else{
print \t,$TempPath, is missing - creating it now\n;
mkdir $TempPath || die can't make $TempPath,\n OS says $!;
}


$TempPath= join ('/',$TempPath,$plist);

if (-f $TempPath){

print \t,$TempPath, exists, checking the locale data\n;
open(IN, $TempPath)|| die can't open $TempPath,\n OS says $!;
@OldPlist=IN;
close (IN);
@DataCheck{@OldPlist}=();

for (@Template){
unless (exists $DataCheck{$_}){
print \t$_ missing from $TempPath, adding\n;
$DataCheck{$_}=() ;
$ChangeFlag=1;

}
@NewPlist=keys(%DataCheck);
if ($ChangeFlag){
$flag = rename $TempPath,$TempPath.'.old';
die can't seem to modify $TempFile, may be permissions 
related\n if $flag;
}
}


} else {
print \t,$TempPath, is missing - creating it now\n;
@NewPlist=@Template;
$ChangeFlag=1;
}

if ($ChangeFlag){


open (OUT,$TempPath) || die can't print to $TempPath,\n OS 
says $!;
print OUT @NewPlist;
close (OUT);
print your locale data has been updated - \nany changes will come 
into effect the next time you log into OSX. \n;
}else { print No data was changed, any problems you might be 
experiencing \nare not connected with your environment.plist\n; }

__DATA__
?xml version=1.0 encoding=UTF-8?
!DOCTYPE plist SYSTEM 
file://localhost/System/Library/DTDs/PropertyList.dtd
plist version=0.9
dict
keyLANG/key
stringus_ENG/string
keyLC_ALL/key
stringC/string
/dict
/plist
==SCRIPT STARTS ABOVE THIS TEXT==




Re: OS Poll

2002-09-20 Thread Robin


On Saturday, September 21, 2002, at 10:14 AM, Rich  Michaela wrote:

 At $129 for a dot release? Not a chance. Maybe to go to 10.5.

 ..Mac is even more of a disappointment. At the same time that Apple is
 pushing as hard as they ever have to get folks to switch, they are
 treating their loyal installed base like crap.

I think what you're seeing is a move away from Apple's apparent basic 
philosophy of fundamentally they just sold computers, and the OS came 
with the computer. In the old business model a major selling point was 
that Macs last a long time - but indestructable computers mean fewer 
customers so obselescence for Macs has traditionally been brought about 
by changes in the OS between technological advances, and there lay the 
flaw they continually subdivided their userbase. In return for brand 
loyalty, they were expected to maintain machines which were 
realistically well out of the technological window.

Now Apple appears to have had a close look at 
thewe've-got-you-over-a-barrel-digital-fiefdom style M$ business model 
where yesterdays bugs become tomorrow's paid upgrades (Apple on Jaguar: 
provides significant enhancements to it's modern, Unix-based 
foundation - for enhancements read bug fixes culled from open 
source development) and stuff like the paid advertising in the quicktime 
viewer (Man I _bought_ the OS - why do I have to look at ads?), combined 
with stepping up the process of obsolecence - since 10.0 paid upgrades 
have appeared with an almost clockwork six monthly cycle, coupled with 
the reduction of the period when new users can upgrade for free, in the 
past this was for the life of an OS ie you buy a computer with OS7, you 
get to update it for free until OS 8. But for me the total biscuit taker 
is the opinion pinchofsalt=1ridiculous/opinion packaging of OSX 
server and OSX client (the difference AFAIK between the two are a 
handfull of carbon apps), and no documentation for the server side of, 
marketed as UNIX based, OSX, or rather I should say no documentation of 
where Apple made changes from the BSD code, and where it didn't.

Inshort as an old mac hand, I like OSX but I think Apple is treating 
people like idiots throwing them glitzy bait to get them running to 
their software/hardware supplier to get the latest and greatest. Sure 
there are changes under the hood, but I went through 10.0 (the most 
advanced OS ever) which had no software or third party drivers, then 
10.1 (now even more powerful) which though slow is stable but probably 
should have been 10.0 in the first place, so at 10.2 (Wildly 
Innovative), to be honest I've had enough carrot and sticking for a 
while, and I also feel a hell of a lot less generous towards Apple (BTW 
anyone know where those quicktime ads come from so I can block the DNS?).

Robin