Re: unix tip of the week

2002-12-16 Thread Riccardo Perotti
On 12/15/2002 11:21 PM, Puneet Kishor wrote:

 
 well, this is really very simple... geeks, please don't laugh. this is
 for newbies only.
 
 1. I have a directory called unixtips.
 2. I have the following files -- index.html, toc.pl, tipdetail.pl,
 unixtips.txt (files shown below)
 3. index.html is a simple frame of two columns with a table of contents
 on the left (toc), and the main body for the tip on the right
 (tipdetail)
 4. unixtips.txt contains the tips I copy from my email. Each tip starts
 with the words TIP:  and ends with . Any code that one types is
 bounded by -- before and after.
 5. that's it. ;-) I told you, it was simple. You can see the tips I
 have collected at
 209.83.8.226/unixtips/index.html. The site is for personal use only, so
 don't be sending a dos attack against it ;-).

[snip the codes]


mmh ... cool. First of all: I saw in your tipdetail.pl frame's html code
that it was output as xml. Why? Is CGI::Pretty doing that? I saw no evidence
of that in your tipdetail.pl script. Just curious...

Now, I guess I'm not that bad of a newbie! Pardon me you all respectable
geeks, but I'm going to dare a little exposure myself (please show mercy!):

I started working on something 'cause I realized I was really being lazy by
asking for a script right away. I did it kind of in a different approach,
basically because I'm stuck with switching between OS9 and OSX all the time
until I have enough money for Jaguar + all the software upgrades, so I had
to do a some pre AppleScripting ... (forgot to mention I use the #$@%/$%
Outlook Express for mail).

I'm definitely going to borrow your *frames* and *color coding* ideas, as
well as the good habit of using CGI.pm and friends instead of hand coding
all the HTML stuff.

Anyway, I wanted a one click solution, but believe it or not, I couldn't get
#$@%/$%  Outlook to open the message in a window via AppleScript command,
so I had to settle with a 2 click solution and open it manually (which is
where I'm going to add your code delimiters).

(1) My AppleScript takes the contents of the opened message window and
passes that to BBedit, which Cleans the mail's headers and footer and passes
the Tip's body to a unix filter UnixTip.pl.

(2) UnixTip.pl takes the tip's header, makes it a filename, writes the tip
in html format that filename and updates the index.htm file by looking for
the !--new-- token.


And here's the codes:
=== My AppleScript (watch out for wrapped long lines) 

property theContent : 
tell application Outlook Express
set theContent to the content of the front window
end tell

tell application BBEdit
make new window with properties {contents:theContent}

--clean up header
find \\r(=-)+=\\r\\r\\s+UNIX GURU UNIVERSE\\s+\\r\\s+UNIX HOT TIP\\s*
 return ¬
 \\s+.+\\r\\r\\s+.+\\r\\r(=-)+=\\r\\r\\r searching in text window
1 options {starting at top:true, search mode:grep} with selecting match
set selection to 

--clean up footer
find \\-+(.+\\r)+\\r(.+\\r)+\\r(.+\\r)+\\r searching in text window 1
options {starting at top:true, search mode:grep} with selecting match
set selection to 

--call perl filter to make html files
set theFilter to OS 9:Applications (Mac OS 9):Authoring:BBEdit
7.0:BBEdit Support:MacPerl Support:Perl Filters:20)MISC:UnixTip.pl
select every text of text window 1
run unix filter theFilter without replacing selection
end tell


=== UnixTip.pl===
#!usr/bin/perl

chomp (my @tip = ());

#get the Tip's title  wipe leading empty lines in body:
my $filename = $header = lc shift @tip;
while ($tip[0] =~ /^$/) { shift @tip }

# Make html filenames
$filename =~ s/ /_/g;
$filename .= '.htm';
my $tips_folder = Docs:Learning:Reference:UNIX:TipOfTheDay;
my $tip_file = $tips_folder:\L$filename\E; #$filename to lowercase!
my $index = $tips_folder:index.htm;

# Make header w/ title:
my $html_header = make_html_header(ucfirst $header);
my $html_footer = make_html_footer();

# Output file:
open OUTFILE, , $tip_file or die could not open $tip_file ($!);
print OUTFILE $html_header;
print OUTFILE $_\n for @tip;
print OUTFILE $html_footer;
close OUTFILE;

# Make it a BBedit file:
MacPerl::SetFileInfo('R*ch', 'TEXT', $tip_file);


# Update Index:
open INDEX, +, $index or die could not open $index ($!);
my @data = (INDEX);
truncate INDEX, 0;
seek INDEX, 0, 0;
for (@data) {
if (/!\-\-new\-\-/) {
print INDEX !--new--\nlia
href='$filename'\u$header/a/li\n;
}
else {
print INDEX $_;
}
}
close INDEX;


#Subs___:
sub make_html_header {
my $filename = shift;

return eo_head;
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
title$filename/title
style type=text/css media=screen
!--
a, a:link , a:visited, a:active {text-decoration: none; }
a:hover {text-decoration: underline;}
--
/style
/head
body bgcolor=#FF 

Re: unix tip of the week

2002-12-16 Thread Riccardo Perotti
I had written:

Too bad I only have one tip to test it on. Can't wait for next week's tip.

I just went back to www.ugu.com and discovered that one gets a Hot Unix
Tip *everyday*!
 
Great! There'll be plenty to test on (and hopefully learn some Unix!!)

Riccardo
--
mailto:[EMAIL PROTECTED]
http://www.riccardoperotti.com





Re: How to build Axpoint?

2002-12-16 Thread David Donovan
hello jking,

I too am having difficulty getting AxPoint to build... I did get libiconv
linked however... the problem is in the Text::Iconv perl module..
you need to hack the Makefile.Pl file like so (assuming you have your
fink stuff in /sw):

use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' = 'Text::Iconv',
'VERSION_FROM' = 'Iconv.pm', # finds $VERSION
'LIBS' = ['-liconv'],   # e.g., '-lm'
'DEFINE'   = '', # e.g., '-DHAVE_SOMETHING'
'INC'  = '-I/sw/include', # e.g., '-I/usr/include/other'
'dist' = {COMPRESS = 'gzip', SUFFIX = 'gz'},
);

 The critical lines are the 'LIBS' and the 'INC'
lines.  These tell the module where to look for the c iconv stuff.
After you do this, you should be able to build XML::SAX and
XML::SAX::Writer (after Text::Iconv).

Now my problem is I can't get the damn pdflibs to build (from
www.pdflib.com). Well, I can get the C libs to build, but fink does:
configure --prefix=/sw --with-zlibs --with-pnglibs --with-tifflibs,
but using external zlibs and pnglibs automagically turns off the ability
to build the perl bindings.  So if you do configure without, and then make
you get the following message:

./libtool --silent --mode=link gcc  -o
libpdf.la -rpath /sw/lib -version-info 2:3:1 ../pdflib/libpdf_.la
../png/libpng.la  ../tiff/libtiff.la ../flate/libz.la -L/sw/lib -framework
CoreServices -framework ApplicationServices  -export-dynamic -lm
ld: ../pdflib/.libs/libpdf_.al(p_stream.lo) illegal reference to symbol:
_deflate defined in indirectly referenced dynamic library
/usr/lib/libz.1.1.3.dylib
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libpdf.la] Error 1
make: *** [pdflib] Error 2

which really pisses me off, because the zlib and the pnglib which come
with pdflib actually build and work, but those -framework flags include
/usr/lib and bugger things up.  but it seems like the thing can't find
it's internal zlib and pnglib.

I've installed the binary versions (I have no idea how they compiled it),
but if you use their built perl module, you get a www.pdflib.com
watermark across the page (they want you to buy a licenses to use the
binary versions, even though the source is open).  though it does
work. grr..

I've posted to the pdflib yahoo group, so if I hear anything I'll pass it
along to you.  But if you have any idea how to wack some sense into the
configure/Makefiles please let me know.

aloha,
david

--- you wrote: -
Axpoint (axpoint.axkit.org) looks like a winner on the how do I make
cool slides without Powerpoint front, but it does not seem to be the
easiest perl module to install under Mac OS X 10.2, because of its various
dependencies on XML modules that depend in turn on other things... In
particular, you have to install libiconv, but when I did that
(libiconv-1.8, in case it matters), I was still getting unresolved symbols
errors from the module that wanted libiconv. And then there's the issue of
installing a (binary-only?) version of pdflib, although that's apparently
now a Fink package. [My issue with pdflib was that the install process on
Mac OS X seemed to consist of doing a sloppy copy without any package
management.] So the question is, does anybody have Axpoint running on
Jaguar, and if so, was there any magic involved beyond having iconv and
pdflib installed first? And, given that the newest version of CPAN (or
Bundle::CPAN) really, really wants you to upgrade to Perl 5.8.0, is the
cleanest and best way to do this just to get a solid (albeit nominally
unstable) Fink installation going first, get Perl 5.8.0 (and libiconv and
pdflib) running in the Fink world, and then try getting Axpoint and
friends to use that Perl? Thanks for any hints on this. I have installed
dozens and dozens of CPAN modules in the past under Linux, but Jaguar is
new to me and just different enough to be annoying for this kind of thing.
jking




Re: How to build Axpoint?

2002-12-16 Thread David Donovan
hello again,

so i got pdflib to build with the perl bindings... it seems that fink sets
CFLAGS and LDFLAGS to /sw/lib or something and this causes the package to
look for external zlibs... so just do an unsetenv on them, and it should
compile (with the exception of tcl, which we know is broken from their web
pages)

hope this helps..

cheers,
david donovan

On Sat, 14 Dec 2002, David Donovan wrote:

 hello jking,

 I too am having difficulty getting AxPoint to build... I did get libiconv
 linked however... the problem is in the Text::Iconv perl module..
 you need to hack the Makefile.Pl file like so (assuming you have your
 fink stuff in /sw):

 use ExtUtils::MakeMaker;
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
 WriteMakefile(
 'NAME' = 'Text::Iconv',
 'VERSION_FROM' = 'Iconv.pm', # finds $VERSION
 'LIBS' = ['-liconv'],   # e.g., '-lm'
 'DEFINE'   = '', # e.g., '-DHAVE_SOMETHING'
 'INC'  = '-I/sw/include', # e.g., '-I/usr/include/other'
 'dist' = {COMPRESS = 'gzip', SUFFIX = 'gz'},
 );

  The critical lines are the 'LIBS' and the 'INC'
 lines.  These tell the module where to look for the c iconv stuff.
 After you do this, you should be able to build XML::SAX and
 XML::SAX::Writer (after Text::Iconv).

 Now my problem is I can't get the damn pdflibs to build (from
 www.pdflib.com). Well, I can get the C libs to build, but fink does:
 configure --prefix=/sw --with-zlibs --with-pnglibs --with-tifflibs,
 but using external zlibs and pnglibs automagically turns off the ability
 to build the perl bindings.  So if you do configure without, and then make
 you get the following message:

 ./libtool --silent --mode=link gcc  -o
 libpdf.la -rpath /sw/lib -version-info 2:3:1 ../pdflib/libpdf_.la
 ../png/libpng.la  ../tiff/libtiff.la ../flate/libz.la -L/sw/lib -framework
 CoreServices -framework ApplicationServices  -export-dynamic -lm
 ld: ../pdflib/.libs/libpdf_.al(p_stream.lo) illegal reference to symbol:
 _deflate defined in indirectly referenced dynamic library
 /usr/lib/libz.1.1.3.dylib
 /usr/bin/libtool: internal link edit command failed
 make[1]: *** [libpdf.la] Error 1
 make: *** [pdflib] Error 2

 which really pisses me off, because the zlib and the pnglib which come
 with pdflib actually build and work, but those -framework flags include
 /usr/lib and bugger things up.  but it seems like the thing can't find
 it's internal zlib and pnglib.

 I've installed the binary versions (I have no idea how they compiled it),
 but if you use their built perl module, you get a www.pdflib.com
 watermark across the page (they want you to buy a licenses to use the
 binary versions, even though the source is open).  though it does
 work. grr..

 I've posted to the pdflib yahoo group, so if I hear anything I'll pass it
 along to you.  But if you have any idea how to wack some sense into the
 configure/Makefiles please let me know.

 aloha,
 david

 --- you wrote: -
 Axpoint (axpoint.axkit.org) looks like a winner on the how do I make
 cool slides without Powerpoint front, but it does not seem to be the
 easiest perl module to install under Mac OS X 10.2, because of its various
 dependencies on XML modules that depend in turn on other things... In
 particular, you have to install libiconv, but when I did that
 (libiconv-1.8, in case it matters), I was still getting unresolved symbols
 errors from the module that wanted libiconv. And then there's the issue of
 installing a (binary-only?) version of pdflib, although that's apparently
 now a Fink package. [My issue with pdflib was that the install process on
 Mac OS X seemed to consist of doing a sloppy copy without any package
 management.] So the question is, does anybody have Axpoint running on
 Jaguar, and if so, was there any magic involved beyond having iconv and
 pdflib installed first? And, given that the newest version of CPAN (or
 Bundle::CPAN) really, really wants you to upgrade to Perl 5.8.0, is the
 cleanest and best way to do this just to get a solid (albeit nominally
 unstable) Fink installation going first, get Perl 5.8.0 (and libiconv and
 pdflib) running in the Fink world, and then try getting Axpoint and
 friends to use that Perl? Thanks for any hints on this. I have installed
 dozens and dozens of CPAN modules in the past under Linux, but Jaguar is
 new to me and just different enough to be annoying for this kind of thing.
 jking






Upgrade Mac::Carbon problems

2002-12-16 Thread Jon Boehm
Hi,

I had a problem upgrading to Mac::Carbon-0.02 tonight.

A) CPAN would not build and install

b) AND THE BIGGEST PROBLEM After installing the binary from the 
MacPerl web I got the following error.

dyld: perl Undefined symbols:
_Perl_sv_2pv
_perl_get_sv
Trace/BPT trap

Then misterhouse, a perl home automation program, died.

I finally had to back off to Mac::Carbon-0.01 before things started 
running again.  Talk about giving me a heart attack.

Anyway hope that helps,
Jon



Speach and Volume

2002-12-16 Thread Jon Boehm
Hi,

I'm using Mac::Carbon0.01.  See my previous post as to why I have not 
upgraded.

So the volume settings in this code snippet are not working correctly:

  my $volume_reset = GetDefaultOutputVolume();
  SetDefaultOutputVolume(2**100);
  SpeakText($Mac_Channel, $mac_text);
  SetDefaultOutputVolume($volume_reset);

The plan was to put the volume at max when talking then return it to 
previous volume when done, but its not working out that way.  What is 
actually happening is that the volume steadily declines with every 
execution of this function until the volume is muted.

Any ideas?

Jon Boehm



DYLD_ALLOW_MULTISYMS

2002-12-16 Thread Kevin Michael Vail
OK, I know I had this working once before.  Trying to install Tk.  I've 
got the DYLD_ALLOW_MULTISYMS environment variable set but I'm still 
getting the note about duplicate definitions of _LangExit in Tk.bundle 
and the other one (Event, I think).

This is under 10.2.2.  Am I correct that you don't need to (and should 
not!) download the hacked version of 'dyld' under Jaguar?

Tk800.024, Perl 5.8.0.

I *know* I'm missing something, I just don't know what.
-- 
Kevin Michael Vail | Dogbert: That's circular reasoning.
[EMAIL PROTECTED]   | Dilbert: I prefer to think of it as no loose ends.
http://www.vaildc.net/kevin/



No output (Newbie question)

2002-12-16 Thread San Tunstall
Hi folks,

I've searched the archives but can't find an answer to this question.

I've run perl scripts from DOS and cygwin but cannot get a basic hello 
world script to work on my Mac.

#! line, permissions on the script, location of perl, etc. seem to be 
ok. But when I try to run a script I get no result. No error message, 
no hello world printed to the terminal. Tried redirecting output to a 
file, but file was empty.

When I try to run perl interactively, it starts up as a process, but I 
get no error messages when I type nonsense and no output to the 
terminal when I enter simple print commands.

Versions:
perl, v5.6.0
osx 10.2

Any idea how to troubleshoot this?

Much obliged
San



Re: DYLD_ALLOW_MULTISYMS

2002-12-16 Thread Jerry LeVan
 OK, I know I had this working once before.  Trying to install Tk.  I've
 got the DYLD_ALLOW_MULTISYMS environment variable set but I'm still
 getting the note about duplicate definitions of _LangExit in Tk.bundle
 and the other one (Event, I think).
 
 This is under 10.2.2.  Am I correct that you don't need to (and should
 not!) download the hacked version of 'dyld' under Jaguar?
 
 Tk800.024, Perl 5.8.0.
 
 I *know* I'm missing something, I just don't know what.


OK, from a post I made awhile ago on comp.lang.perl.tk,  , Mac Jaguar and
Perl/Tk, is it safe? the following was the response:

Subject:
Re: Mac Jaguar and Perl/Tk, is it safe?
From:
Michael Doster [EMAIL PROTECTED]
Date:
Tue, 27 Aug 2002 02:30:53 GMT
Newsgroups:
comp.lang.perl.tk

Hello all,

In Mac OS X 10.2, a hacked dyld is no longer necessary to get Perl/Tk to
work.  Here's how:

1) First, upgrade to Mac OS 10.2 (Jaguar). If you do a clean install, pay
close attention to steps 3 and 4.

2) Install the latest development tools from the included Developer Tools
CD.



3) If XDarwin doesn't work - and it won't if you did a clean install
- them simply reinstall from:


http://sourceforge.net/project/showfiles.php?group_id=18034release_id=71056

First install XInstall_10.1.sit
Then install the fixed xterm  Jaguar_XTerm_Update.zip.

4) If you run OroborOSX and need to re-install, get it here:

   http://oroborosx.sourceforge.net/download.html#v075a1

5) Fetch perl-5.8.0.tar.gz from CPAN and install thusly:

   tar -zxpf perl-5.8.0.tar.gz
   cd perl-5.8.0
   sh Configure -des
   make
   make test  (97% pass)
   sudo make install

That replaces the default Apple 5.6.0 Perl.

6) Fetch Tk800.024.tar.gz from your favorite CPAN mirror such as this one:

   http://mirrors.develooper.com/perl/backup.pause/authors/id/N/NI/NI-S/

   tar -zxpf Tk800.024.tar.gz
   cd Tk800.024
   perl -v  (ensure 5.8.0 is found)


7) Make the following changes to Tk/MMutil.pm in the const_config
subroutine:

 if ($^O eq 'MSWin32'  $Config{'ccflags'} =~ /-DPERL_OBJECT/)
  { 
   $self-{'LDFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g;
   $self-{'LDDLFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g;
  }
 elsif ($^O eq 'darwin' )
  {
   $self-{'LDDLFLAGS'} =~ s/-flat_namespace\s+//;
   $self-{'LDDLFLAGS'} =~ s/-undefined\s+suppress\s+//;
   if ( -e $Config{'archlib'}/CORE/$Config{'libperl'} ) {
$self-{'LDDLFLAGS'} .=  -L\${PERL_ARCHLIB}/CORE -lperl ;
   }
   elsif ( -e /System/Library/Perl/darwin/CORE/libperl.dylib ) {
$self-{'LDDLFLAGS'} .=  -L/System/Library/Perl/darwin/CORE -lperl ;
   }
   else {
warn Can't find libperl.dylib;
   }
   $self-{'LDFLAGS'} =~ s/-flat_namespace\s+//;
   $self-{'LDFLAGS'} =~ s/-undefined\s+suppress\s+//;
  }
 elsif ($^O =~ /(openbsd)/i)

8) While running XDarwin and your favorite terminal app (xterm,rxvt, etc.)
do the usual from the Tk800.024 directory:

   perl Makefile.PL
   make
   make test
   sudo make install





in article ak996q$[EMAIL PROTECTED], Stephen O. Lidie at
[EMAIL PROTECTED] wrote on 8/24/02 8:43 PM:


 Michael Doster [EMAIL PROTECTED] wrote:

 Sorry for the inconvenience, but it appears that the new dyld is not ready
 for primetime after all. I'll let you know when it's fixed.

 

 -- Mike :-(

 


--Jerry




RE: No output (Newbie question)

2002-12-16 Thread Deshazer, Earl (GEAE)
Well,
I have had that problem several times and I figured out there could be
one of two problems.
1) Hidden Mac endings in your script (\r) when it should be unix (\n)
2) Executing in Mac is ./script_name

With regards to the first problem, if you edit the file in vi or emacs, then you
should be okay. If you edit the file in BBedit, then you have to go and choose
one of the options that saves with Unix endings. I don't know what you do in
other editors.

With regard to command execution. Unlike the flavors of Unix that I am familiar
with, Unix requires a specification on where the command is thus ./

Good Luck,
Will DeShazer

-Original Message-
From: San Tunstall [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 15, 2002 10:48 PM
To: [EMAIL PROTECTED]
Subject: No output (Newbie question)


Hi folks,

I've searched the archives but can't find an answer to this question.

I've run perl scripts from DOS and cygwin but cannot get a basic hello 
world script to work on my Mac.

#! line, permissions on the script, location of perl, etc. seem to be 
ok. But when I try to run a script I get no result. No error message, 
no hello world printed to the terminal. Tried redirecting output to a 
file, but file was empty.

When I try to run perl interactively, it starts up as a process, but I 
get no error messages when I type nonsense and no output to the 
terminal when I enter simple print commands.

Versions:
perl, v5.6.0
osx 10.2

Any idea how to troubleshoot this?

Much obliged
San



Re: No output (Newbie question)

2002-12-16 Thread Peter N Lewis
#! line, permissions on the script, location of perl, etc. seem to 
be ok. But when I try to run a script I get no result. No error 
message, no hello world printed to the terminal. Tried redirecting 
output to a file, but file was empty.

Check the line endings on the file, this is a classic symptom of 
having the wrong line endings such that the entire file looks like a 
single line, all commented out by the leading #
   Peter.
--
http://www.interarchy.com/  http://download.interarchy.com/


Ruby advantages and shortcomings over Perl

2002-12-16 Thread Emmanuel. M. Decarie
Hello,

I have read very good things about Ruby and I was wondering if anyone
with experience with this language could provide an insight on what
are its advantages and shortcomings over Perl.

http://www.ruby-lang.org/en/index.html
http://www.linux-mag.com/2002-04/ruby_01.html
http://www.rubycentral.com/book/index.html
http://www.modruby.net/index.html.en

TIA


--
__
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Frontier - Perl - PHP - Javascript - XML  http://scriptdigital.com/



Re: Upgrade Mac::Carbon problems

2002-12-16 Thread Chris Nandor
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Jon Boehm) wrote:

 I had a problem upgrading to Mac::Carbon-0.02 tonight.
 
 A) CPAN would not build and install

 b) AND THE BIGGEST PROBLEM After installing the binary from the 
 MacPerl web I got the following error.
 
 dyld: perl Undefined symbols:
 _Perl_sv_2pv
 _perl_get_sv
 Trace/BPT trap

It looks like you are using perl 5.8.0.  I didn't note in the README that it 
was for perl 5.6 (the two are not binary compatible).  It shouldn't matter 
in the future, because there's no problem anymore building with perl 5.8.0.

See the previous post about 0.02_01, or wait a day or so for 0.03 to be 
released.

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/



Re: DYLD_ALLOW_MULTISYMS

2002-12-16 Thread rick
Quoting Kevin Michael Vail [EMAIL PROTECTED]:

 OK, I know I had this working once before.  Trying to install Tk.  I've
 
 got the DYLD_ALLOW_MULTISYMS environment variable set but I'm still 
 getting the note about duplicate definitions of _LangExit in Tk.bundle
 
 and the other one (Event, I think).
 
 This is under 10.2.2.  Am I correct that you don't need to (and should
 
 not!) download the hacked version of 'dyld' under Jaguar?
 
 Tk800.024, Perl 5.8.0.
 

Funny, I just went through this yesterday.

After some googling, I discovered that DYLD_ALLOW_MULTISYMS is out under
jagauar. The dynloader has been fixed. The problem is the usual flat_namespace
issue.

Quoting http://www.lehigh.edu/~sol0/Macintosh/X/ptk/ :

7) Make the following changes to Tk/MMutil.pm in the const_config
subroutine:

 if ($^O eq 'MSWin32'  $Config{'ccflags'} =~ /-DPERL_OBJECT/)
  { 
   $self-{'LDFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g;
   $self-{'LDDLFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g;
  }
 elsif ($^O eq 'darwin' )
  {
   $self-{'LDDLFLAGS'} =~ s/-flat_namespace//;
   $self-{'LDDLFLAGS'} =~ s/-undefined\s+suppress//;
   if ( -e $Config{'archlib'}/CORE/$Config{'libperl'} ) {
$self-{'LDDLFLAGS'} .=  -L\${PERL_ARCHLIB}/CORE -lperl ;
   }
   elsif ( -e /System/Library/Perl/darwin/CORE/libperl.dylib ) {
$self-{'LDDLFLAGS'} .=  -L/System/Library/Perl/darwin/CORE -lperl ;
   }
   else {
warn Can't find libperl.dylib;
   }
   $self-{'LDFLAGS'} =~ s/-flat_namespace//;
   $self-{'LDFLAGS'} =~ s/-undefined\s+suppress//;
  }
 elsif ($^O =~ /(openbsd)/i)

8) While running XDarwin and your favorite terminal app (xterm,rxvt, etc.)
do the usual from the Tk800.024 directory:



rick



Re: Test Mac::Carbon build for me?

2002-12-16 Thread Emmanuel. M. Decarie
À (At) 18:07 -0500 14/12/02, Chris Nandor écrivait (wrote) :

In article p05200f0dba2013320b77@[192.168.0.2],
 [EMAIL PROTECTED] (Emmanuel. M. Decarie) wrote:


 Mac-Carbon-0.02 01 doesn't compile on my machine. I get this error:

 /usr/include/gcc/darwin/2.95.2/g++/../stdbool.h:10: warning: empty
declaration
 AppleEvents.xs: In function `XS Mac  AppleEvents AESend':
 AppleEvents.xs:624: `keyReplyPortAttr' undeclared (first use in
this function)
 AppleEvents.xs:624: (Each undeclared identifier is reported only once
 AppleEvents.xs:624: for each function it appears in.)
 make[1]: *** [AppleEvents.o] Error 1
 make: *** [subdirs] Error 2


Could you search your system headers for keyReplyPortAttr?


Hmm, not sure what you are saying here. I just know basic C and I'm
not familiar with the Carbon framework. Where are my system headers?

I tried that though:

% grep -r keyReplyPortAttr  /System/Library/Frameworks/*

But it take forever to run. If you give me more details, I'll try again.


If you can't find it, try (in Carbon.h, or AppleEvents.xs):

   #define keyReplyPortAttr 'repp'


Ok, in Carbon.h, in the beginning of the file:

#ifndef _MAC_CARBON_H
#define _MAC_CARBON_H
#define keyReplyPortAttr 'repp'


See if that works.


Well it pass most of the tests (btw, these tests are very funny)

t/Carbon..._ComponentCacheableInitialize
t/Carbon...ok
Components/t/Components_ComponentCacheableInitialize
Components/t/Componentsok
Files/t/Files..ok
Gestalt/t/Gestalt..ok
MacPerl/t/MacPerl..ok 3/13_ComponentCacheableInitialize
Argument 10.1.2 isn't numeric in numeric ge (=) at
MacPerl/t/MacPerl.t line 40.
MacPerl/t/MacPerl..ok 10/13# Failed test
(MacPerl/t/MacPerl.t at line 88)
#  got: '2'
# expected: '3'
MacPerl/t/MacPerl..ok 12/13# Looks like you failed 1 tests of 13.
MacPerl/t/MacPerl..dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 11
Failed 1/13 tests, 92.31% okay
Memory/t/Memoryok
MoreFiles/t/MoreFiles..ok
Notification/t/Notificationok
Processes/t/Processes..ok
2/6 skipped: No parent
Resources/t/Resources..ok
Sound/t/Sound.._ComponentCacheableInitialize
Sound/t/Sound..ok
Speech/t/Speechok 3/8_ComponentCacheableInitialize
Speech/t/Speechok
Types/t/Types..ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
MacPerl/t/MacPerl.t1   256131   7.69%  11
2 subtests skipped.
Failed 1/13 test scripts, 92.31% okay. 1/85 subtests failed, 98.82% okay.
make: *** [test_dynamic] Error 35

I didn't do a make install.

Cheers
-Emmanuel

--
__
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Frontier - Perl - PHP - Javascript - XML  http://scriptdigital.com/



Re: Test Mac::Carbon build for me?

2002-12-16 Thread Chris Nandor
In article p05200f0bba23a385de61@[192.168.0.2],
 [EMAIL PROTECTED] (Emmanuel. M. Decarie) wrote:

 À (At) 18:07 -0500 14/12/02, Chris Nandor écrivait (wrote) :
 Could you search your system headers for keyReplyPortAttr?
 
 Hmm, not sure what you are saying here. I just know basic C and I'm 
 not familiar with the Carbon framework. Where are my system headers?
 
 I tried that though:
 
 % grep -r keyReplyPortAttr  /System/Library/Frameworks/*
 
 But it take forever to run. If you give me more details, I'll try again.

Yes, it could take forever.  :-)  I am not sure how to better narrow it 
down, though.  Maybe use find(1) to look for *.h files.


 If you can't find it, try (in Carbon.h, or AppleEvents.xs):
 
 #define keyReplyPortAttr 'repp'
 
 Ok, in Carbon.h, in the beginning of the file:
 
 #ifndef  MAC CARBON H
 #define  MAC CARBON H
 #define keyReplyPortAttr 'repp'
 
 See if that works.
 
 Well it pass most of the tests (btw, these tests are very funny)

Good, and :).


 t/Carbon..._ComponentCacheableInitialize
 t/Carbon...ok

As noted in a previous post, some Components when initialized or used or 
something decide to emit text to STDERR (hopefully, it's STDERR, not 
STDOUT!).  I consider this behavior broken on behalf of the component, 
though I suppose I could be wrong.  But you should see this any time you run 
anything on the command line that loads in components, such as osascript(1).

So basically, I don't know I can do anything to quiet that 
_ComponentCacheableInitialize.


 MacPerl/t/MacPerl..ok 3/13 ComponentCacheableInitialize
 Argument 10.1.2 isn't numeric in numeric ge (=) at 

Fixed for 0.03.


 MacPerl/t/MacPerl.t line 40.
 MacPerl/t/MacPerl..ok 10/13# Failed test 
 (MacPerl/t/MacPerl.t at line 88)
 #  got: '2'
 # expected: '3'
 MacPerl/t/MacPerl..ok 12/13# Looks like you failed 1 tests of 13.
 MacPerl/t/MacPerl..dubious
  Test returned status 1 (wstat 256, 0x100)
 DIED. FAILED test 11
  Failed 1/13 tests, 92.31% okay

Weird.  Are you sure you clicked Cancel?


 Processes/t/Processes..ok
  2/6 skipped: No parent

Odd.  You ran this on the local machine from Terminal.app?

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/



Re: unix tip of the week

2002-12-16 Thread Puneet Kishor
Riccardo Perotti wrote:

On 12/15/2002 11:21 PM, Puneet Kishor wrote:



well, this is really very simple... geeks, please don't laugh. this is
for newbies only.


..


(1) My AppleScript takes the contents of the opened message window and
passes that to BBedit, which Cleans the mail's headers and footer and passes
the Tip's body to a unix filter UnixTip.pl.

(2) UnixTip.pl takes the tip's header, makes it a filename, writes the tip
in html format that filename and updates the index.htm file by looking for
the !--new-- token.


And here's the codes:
=== My AppleScript (watch out for wrapped long lines) 


cool! tmtowtdi.




do compilers make a difference OR why is my perl slow

2002-12-16 Thread Puneet Kishor
Folks,

I recently read that gcc is a dog. (I am heavily paraphrasing for the 
sake of brevity). The same program compiled with a different compiler 
ran significantly faster.

That specific article itself is irrelevant. But what inquiring (and 
clueless) minds want to know, is my OS X perl slower that my ActiveState 
perl because of the compilers used to compile the perl binary in the 
first place. Yes, I know comparing different platforms is tricky -- cpu 
speed, ram, cpu architecture, other daemons running, etc. But, in an 
overall sense of things -- does gcc make things slower?

In some spare time I did some empirical testing using the same script on 
perl 5.6.1 on Win2k (PIII/833 Mhz/512 Mb ram/apache, and no other 
significant daemons) versus perl 5.6.1 on OS X (G3/600 Mhz/640 Mb 
ram/apache, and no other significant daemons). I started with a file 
with email addresses (one per line), many being duplicates. A small perl 
script first removed the duplicates then sorted results, and wrote 'em 
out to another file. The only catch -- the original file was 145 Mb with 
close to 3.5 million lines (I created that by simply cat-in  the same 
file over and over again to an output file until my fingers got tired). 
The end result was a svelte, 600+ line file, about 11 kb.

The operation took about 122 secs on the Windows machine, and 299 
seconds on the iBook.

Yes, the iBook CPU is 200 Mhz slower, and god only knows how we can 
compare a P3 to G3, but 2.5 times the time taken is a bit much. Coming 
back to my initial assertion -- Could some of this be attributed to the 
way the perl binary is compiled?


The test script follows. The only difference on the platforms was the 
shebang line.

I used the following script (some code is mine, some from the cookbook). 
I used my own crude benchmark.

#!c:\perl\bin\perl.exe -w
my $start = time();

my $file = c:/htdocs/testers/dupes/dupes2.txt;

open IF, $file or die $!;
open OF, c:/htdocs/testers/dupes/filewithoutdupes.txt or die $!;

my @list;
push(@list, $_) while (IF);

my %seen = ();
my @uniq;
foreach my $item (@list) {
push(@uniq, $item) unless $seen{$item}++;
}

my @uniqsorted = sort @uniq;
print OF @uniqsorted;

close IF;
close OF;
my $end = time();
my $dur = $end - $start;
print This took $dur seconds\n;



Re: do compilers make a difference OR why is my perl slow

2002-12-16 Thread Chris Devers
On Mon, 16 Dec 2002, Puneet Kishor wrote:

 Yes, the iBook CPU is 200 Mhz slower, and god only knows how we can
 compare a P3 to G3, but 2.5 times the time taken is a bit much. Coming
 back to my initial assertion -- Could some of this be attributed to the
 way the perl binary is compiled?

There's too many variables here to draw any meaningful conclusions. Rather
than compare the PC to the Mac, try to compare just GCC to $other_compiler
by, for example, comparing two different versions of Perl on just the PC.

My understanding is that ActiveState compiles their software against VC++,
while my assumption is that Cygwin probably compiles theirs against GCC.
So it try that way then: install the ActiveState  Cygwin versions of Perl
on your PC (and for laughs, maybe install Cygwin's development tools and
build your own copy of Perl against their version of GCC, just so you
don't have to wonder how they built theirs), Then repeat your test (and
maybe others) comparing the two versions of Perl on the same machine.

If you do it that way, you'll eliminate any differences between processor
architectures  speeds, ram quantity  speed, operating system quirks,
etc.

I'd be interested in the results of such a test, actually...


-- 
Chris Devers[EMAIL PROTECTED]

In every hierarchy the cream rises until it sours.
-- Dr. Laurence J. Peter



RE: No output (Newbie question)

2002-12-16 Thread San Tunstall
You are right. That was exactly the problem. Needed to tell BBedit waht
kind of end-of-line to use. Thanks!

On Mon, 16 Dec 2002 09:02:08 -0500, Deshazer, Earl (GEAE)
[EMAIL PROTECTED] said:
   I have had that problem several times and I figured out there could be
 one of two problems.
 1) Hidden Mac endings in your script (\r) when it should be unix (\n)
 ...
 With regards to the first problem, if you edit the file in vi or emacs,
 then you
 should be okay. If you edit the file in BBedit, then you have to go and
 choose one of the options that saves with Unix endings.




Re: Test Mac::Carbon build for me?

2002-12-16 Thread John R. Fraser Jr.
Successful build on my Mac iBook running 10.2.2.  A very cool package, 
thanks.

John

On Thursday, December 12, 2002, at 05:18 PM, Chris Nandor wrote:

http://dev.macperl.org/tmp/Mac-Carbon-0.02_01.tar.gz

If you have the time, please try this build out, compiling and testing.
It's been tested with perl 5.6.0 and gcc2/gcc3 on Mac OS X 10.2, but I
imagine it should work with any combination of perl 5.6.0/5.6.1/5.8.0,
gcc2/gcc3, and Mac OS X 10.1/10.2.

Thanks,

--
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/





Re: No output (Newbie question)

2002-12-16 Thread Rich Michaela


Deshazer, Earl (GEAE) wrote:



 With regard to command execution. Unlike the flavors of Unix that I am familiar
 with, Unix requires a specification on where the command is thus ./

This has nothing to do with what flavor of UNIX you're running. and everything to
do with your PATH environment variable. Where is the script located? If it's in
your path it will execute by calling by name. If not you'll nned to qualify the
path to the file, or (as in this example) if you're in the same directory, prepend
the ./filename. OS X's somewhat un-UNIX-like Directory names, means care must be
taken when defining your PATH variable. If you're on a multi-user machine, avoid
the temptation of adding a . to your PATH. One standard appraoch is to define a
bin directory under your $HOME, then adding $HOME/bin or ~/bin to the end of you
PATH.