Re: ANNOUNCE: Perl Dev Kit 7.0 Beta 2 available

2007-02-02 Thread Tommy Nordgren


On 2 feb 2007, at 19.06, kurtz le pirate wrote:


In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Jan Dubois) wrote:


I'm happy to announce the release of the Perl Dev Kit 7.0 Beta 2.

  http://www.activestate.com/products/perl_dev_kit/beta.plex

...



seems attractive but :
System Requirements
* Mac OS X 10.4 Tiger or later
* ActivePerl build 816 or later --



--  
klp

So what? ActiveState Prel for Mac OS X is easy to download.
It installs in a subdirectory of /usr/local, so it won't overwrite  
the existing Apple-built perl.

--
Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone
[EMAIL PROTECTED]




Re: Uh-oh, the C compiler 'cc' doesn't seem to be working.

2006-10-28 Thread Tommy Nordgren


On 28 okt 2006, at 13.00, Joel Rees wrote:

PPC Mac Mini, Mac OS X 10.4.8, I'm following along in README.macosx  
and I've done this:


export SDK=/Developer/SDKs/MacOSX10.4u.sdk

and I call

./Configure -Accflags=-nostdinc -b$SDK/user/include/gcc -B$SDK/usr/ 
lib/gcc -isystem$SDK/usr/include -F$SDK/System/Library/Frameworks - 
Aldflags=-W1,-syslibroot,$SDK


as suggested. I take defaults until it checks the compiler. Here's  
the what happens there:


--
Use which C compiler? [cc]
powerpc-apple-darwin8-gcc-4.0.1: '-b' must come at the start of the  
command line


	This message is clearly indicative. You should try putting the -b  
option first in -Accflags
-Accflags=-b$SDK/user/include/gcc  -nostdinc -B$SDK/usr/lib/gcc - 
isystem$SDK/usr/include -F$SDK/System/Library/Frameworks

Uh-oh, the C compiler 'cc' doesn't seem to be working.
powerpc-apple-darwin8-gcc-4.0.1: '-b' must come at the start of the  
command line

Uh-oh, the C compiler 'cc' doesn't seem to be working.
You need to find a working C compiler.
Either (purchase and) install the C compiler supplied by your OS  
vendor,

or for a free C compiler try http://gcc.gnu.org/
I cannot continue any further, aborting.
--

The README indicates that the parameters are useful for making perl  
aware of the SDK, as I understand it, so I'm going to try this  
without parameters.


But I thought I'd go ahead and ask if anyone can confirm that these  
parameters aren't necessary if I'm not making the parallel install  
aware of the sdk, or if anyone can give me a hint about what I'm  
doing. (I've never used such parameters when compiling perl in the  
past, haven't done an install in a year or so.)


There is a possibility I erased part of the SDK when I was  
intending to move an alias to XCode into the applications folder  
and forgot that the actual bundle moves when users that can modify  
the applications folder (admin users) drag and drop wtihout the  
option key.


Also, the notes in README.macosx seem to indicate that shared  
libraries and threads are now functional. Anyone on the list here  
using them with (parallel installs of) apache 2 and mod_perl?


-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]





Writing utf 8 files

2006-06-22 Thread Tommy Nordgren
How do I write proper utf 8 characters to a file? I write only two  
characters, and they come out as four

garbage characters when I view the file in an editor.
-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]





Re: Writing utf 8 files

2006-06-22 Thread Tommy Nordgren


22 jun 2006 kl. 20.15 skrev Sherm Pendley:


On Jun 22, 2006, at 1:48 PM, Tommy Nordgren wrote:

How do I write proper utf 8 characters to a file? I write only two  
characters, and they come out as four

garbage characters when I view the file in an editor.


Quick answer:

open FH, :utf8, file;

Complete answer:

perldoc perluniintro
perldoc PerlIO

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


I've already tried that. That was what i was doing when I got garbage.
-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]





Re: Writing utf 8 files

2006-06-22 Thread Tommy Nordgren


22 jun 2006 kl. 20.29 skrev Tommy Nordgren:



22 jun 2006 kl. 20.15 skrev Sherm Pendley:


On Jun 22, 2006, at 1:48 PM, Tommy Nordgren wrote:

How do I write proper utf 8 characters to a file? I write only  
two characters, and they come out as four

garbage characters when I view the file in an editor.


Quick answer:

open FH, :utf8, file;

Complete answer:

perldoc perluniintro
perldoc PerlIO

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

	I've already tried that. That was what i was doing when I got  
garbage.


I found the problem it is necessary to
1) use the use utf8 pragma;
2) Explicitly write a BOM byte sequence immediately after opening the  
file.

point 2 is where I erred. I expected the BOM to be added automatically,
when opening a file for write with the utf-8 encoding.
-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]





Re: Waiting until Acrobat closes file

2006-06-10 Thread Tommy Nordgren


On 28 maj 2006, at 01.34, David Cantrell wrote:


On Sun, May 28, 2006 at 12:27:02AM +0200, Tommy Nordgren wrote:


My perl script generates pdf files, and opens them with Acrobat.
How can I wait until Acrobat closes the file, so I can delete it?


system('acroread', 'myfile.pdf');
unlink('myfile.pdf');


There is no 'acroread' , at least not with only the reader installed

if instead you're doing something like ...

system('open', '/Applications/Acrobat.app');

then you'll need to:

wait around until Acrobat appears in the process table;
wait around until that PID disappears;


1. Acrobat may already be running when told to open a document.
	2. I would prefer being able to remove the file as soon as it is  
closed, keeping the reader

running is preferable, since it has long start up time.

Will it work to:
a) Wait until Acrobat Reader is running
b) Sleep long enough to make sure acrobat has opened the file
c) Open the file in read/write mode, and wait until a write lock can  
be aquired

d) Then , close and remove the file

Check out Mac::Processes on the CPAN.

--
David Cantrell | random organic glop and a metric fuckton of  
electricity


Wow, my first sigquoting! I feel so special now!
-- Dan Sugalski


--
Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone
[EMAIL PROTECTED]




Waiting until Acrobat closes file

2006-05-27 Thread Tommy Nordgren

My perl script generates pdf files, and opens them with Acrobat.
How can I wait until Acrobat closes the file, so I can delete it?
--
Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone
[EMAIL PROTECTED]




Backtick operator, and Unicode

2005-09-22 Thread Tommy Nordgren
I tried to to parse the output of calling nibtool with the -L option,  
in the backtick operator.

Nibtool defaults to utf-16.

Attempting to do a split with the pattern /=/  failed, by not  
splitting the input string.


This could be fixed by either;
1) Passing the --utf8 option to nibtool,
and in the perl script specifying
use utf8
2) Pass the -R  (macroman encoding option) to nibtool.

Are there any ways to parse nibtool output generated by the backtick  
operation,
that don't require hardcoding character encoding used by the perl  
script, and
don't require hardcoding the output character encoding of the nibtool  
-L command


My Perl script is as follows in the latest version:
#!/usr/bin/perl
use strict;
use warnings;
use utf8;

if ( @ARGV !=2) {
die Usage: nibfixup Nibfile Applicationname\n ;
}

my $nibfile = $ARGV[0];
my $appname = $ARGV[1];

my ($nibdir,$nibname) = ($nibfile =~ /^(.*\/)?([A-Za-z]+\.nib)$/);
$nibdir = '' unless $nibdir;

#call Nibtool, reading the userinterface strings of the nibfile into  
dictionary.

my $dictionary = `/usr/bin/nibtool --utf8 -L $nibfile`;

my @dictionary = split(/\n/,$dictionary);

open (DICT,'','temp.strings') or die Could not open dictionary file 
\n;


#replace the word NewApplication by the second comman line parameter
#in the localized strings whereever it occurs.
for my $i (@dictionary) {
my @i = split /=/ , $i;
if (1 ==  scalar @i) {
print DICT $i,\n;
} else {
if (scalar @i) {
my $j = shift @i;
print DICT $j=;
$j = shift @i;
$j =~ s/NewApplication/$appname/o;
print DICT $j;
for $j (@i) {
print DICT =$j;
}
}
print DICT \n;
}
}

close DICT;

#rename the nib file
system ('/bin/mv' ,$nibfile ,${nibdir}old.$nibname)==0 or die  
Could not rename nib file\n;


#use Nibtool to set The application name to correct value in the user  
interface
system ('/usr/bin/nibtool' ,'--utf8','-w',$nibfile,'- 
d','temp.strings',${nibdir}old.$nibname)

== 0 or die Could not update nibfile\n;

#remove old nib, and temporary dictionary.
system ('/bin/rm', '-rf', ${nibdir}old.$nibname) == 0 or die Could  
not remove nib copy\n;
system ('/bin/rm', 'temp.strings') == 0 or die Could not remove  
temporary dictionary\n;


-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]





Writing Configure scripts in Perl

2005-04-24 Thread Tommy Nordgren
What are the tools I need to get to be able to build configure scipts 
in perl.
I wan't to be able to automatically determine the set of tools avaible, 
and generate
make files for my projects. Some tools generate a shell script, but 
I've seen other open
source packages where the config script is written in Perl.

Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone


Any GUI tools that can set execute bit?

2005-03-03 Thread Tommy Nordgren
Are there any Graphical User Interface Tools that can set the 
executable bits in the file info on disk?
Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone



Re: What Perl editor do you recommend?

2005-03-02 Thread Tommy Nordgren
There is a double clickable version of emacs available. There is a link 
to it at Apple's sight.

Mar 2, 2005 kl. 6:38 PM skrev Ted Zeng:
Hi,
Thanks for the help here. I am almost finishing my first tool on OS X.
I am using TextEdit as the editor. I sometime use Pico, but I am still
not comfortable with Unix editor. I know there must be some good
editors for Perl. Do you have any recommendation?
ted zeng
Adobe Systems

Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone


Building external modules

2005-02-18 Thread Tommy Nordgren
Where can I find printed docs on how to build external modules on MacOS 
X?
For some reasons perldoc don't work correctly when piping output into 
the lpr command.
All titles/subtitles get duplicated cchhaarraacctteerrss (like the 
previous word), making the output nearly unreadable.
Are there any suitable books on this topic?
Home is not where you are born, but where your heart finds peace -
Tommy Nordgren, The dying old crone