Re: Module Aspell::Text does not install

2006-12-13 Thread Rick Frankel
On Tue, Dec 12, 2006 at 10:46:46PM +0100, Marek Stepanek wrote:
 t/05-coreNOK 4/17
 #   Failed test 'Make sure word test is in dictionary'
 #   at t/05-core.t line 37.
 # 
 
 # * Error: No word lists can be found for the language en_US.
 # *
 # * Are you sure you have the Aspell en_US dictionary installed?

This is your hint. You have aspell installed but no dictionaries.
since you are refering to /sw, i assume you have used fink to install
aspell. From the fink website:

Package aspell
...
Description: Spell checker better than ispell

No dictionaries are installed - you'll need to install the
aspell-en package or another aspell dictionary. Dictionaries that were
used on previous versions of aspell must be updated to work with this
version.

You need to install the package aspell-en.


rick



Re: psync backup problems: suggestions?

2005-07-11 Thread Rick Frankel
On Sun, Jul 10, 2005 at 09:39:03PM -0700, Randal L. Schwartz wrote:
  Christopher == Christopher D Lewis [EMAIL PROTECTED] writes:
 
 Christopher Dear psync users,
 
 This may not help, but I'm about to be a former psync user, because
 Tiger's rsync now understands the HFS fork, if you include -E.  This
 presumably also includes the extended-access lists which psync won't
 handle.

Note that there is a known problem with rsync on tiger and large
files. I tries switching my backup regimen to rsync but had to switch
back to psync due to the crashes.

rick
 


Re: ANN: ShuX 3.0-beta2

2005-03-26 Thread Rick Frankel
On Fri, Mar 25, 2005 at 03:10:29PM -0500, Sherm Pendley wrote:
 On Mar 25, 2005, at 3:05 PM, Sherm Pendley wrote:
 
The latest release of ShuX, 3.0.beta2, is available for download at:

The new perl... button works much better. One new problem though:

If any field in a Document Set is left blank, that top-level node
in the DocSet Browser becomes a file system browser anchored at '/'!

I think it would be better if the top-level entries either did nothing
or (my preference) removed from the browser entirely if not set.

rick


Re: New to list, greetings and a (newbie)problem

2004-12-22 Thread Rick Anderson
On Dec 22, 2004, at 12:53 PM, Isaac Sherman wrote:
I'm new to this list, and I am new to Perl as well.
Isaac, just judging from your problem, it appears that you're probably 
a bit new to all things Unix as well (not trying to sound 
condescending, just an observation.) I got on OS X for the first time 
two years ago and that's about where I was so I can relate to what 
you're going through. I had lots of programming experience, had perl 
experience (via MacPerl), was a long time user of the classic Mac OS, 
and had a faint smattering of Unix know-how, but I kept running into 
odd frustrations like what you describe too because I didn't totally 
understand the whole Unix thing. Now I do and it's like a whole other 
world (well... it is, but anyway.)

My advice--if my assumption is correct--would be to seek out a few Unix 
books. I bought a couple of old Unix beginner books from secondhand 
stores and they proved to be worth every penny. Even outdated books on 
the topic are fine, anything to get your head around the whole concept 
of what's going on and how things like perl interact with the command 
line and whatnot. I'm still amazed at how powerful it all is and how I 
literally could not do my current job without the sort of understanding 
that I have now. It pays off in ways you simply cannot imagine.

--Rick Anderson
The only difference between me and a madman,
is that I am not mad. -- Salvador Dali


Re: BBEdit 8.0

2004-09-10 Thread Rick Anderson
On Sep 9, 2004, at 5:41 PM, Ian Ragsdale wrote:
Effortless  transparent handling  switching of line endings.
It's the little things that matter, isn't it? You'd almost be able to 
write-off this feature as trivial until you start dealing with the 
hassles that line endings from different platforms can cause. 
Developing in a mixed platform environment can be a real nightmare.

I do all my Perl scripting in BBEdit on OS X, almost exclusively, 
primarily to avoid issues with line endings. My boss works on a Windows 
machine and occasionally has to alter my scripts there (or data files 
associated with them) forgetting sometimes that Notepad will change the 
line breaks to DOS style which causes the script to fail online. He 
occasionally comments that he wishes there were something on Windows 
like BBEdit.

I've done a lot of searching and a lot of asking around, but have yet 
to find such a thing. Is there a text editor (preferably something 
simple) on Windows that allows you to deal with line breaks the way 
BBEdit does?

--Rick Anderson
The only difference between me and a madman,
is that I am not mad. -- Salvador Dali


Re: Time::Local problem

2004-08-30 Thread Rick Measham
On 30 Aug 2004, at 8:15 PM, David Ledger wrote:
Can anyone explain the following? (the difference in commands is the 
year spec.)

[EMAIL PROTECTED]: perl -e 'use Time::Local;print ( (localtime(timelocal(0, 0, 
0, 1, 1, 55)))[6], \n);'
2
[EMAIL PROTECTED]: perl -e 'use Time::Local;print ( (localtime(timelocal(0, 0, 
0, 1, 1, 54)))[6], \n);'
Cannot handle date (0, 0, 0, 1, 1, 2054) at -e line 1
[EMAIL PROTECTED]:

All years I've tried  55 are Ok; all years I've tried  54 fail.
As Sherm has pointed out, it's due to the two-digit year wrap around. 
(Remember the so-called Millennium bug? That's what you're perpetuating 
in the above code)

Your best bet for anything to do with dates and times is to use the 
DateTime modules. They work on all platforms and comprehensively handle 
any date and time you can throw at it (right up to $MAXINT-12-31). They 
handle localization and know all current and historic DST rules back to 
1972.

Cheers!
Rick Measham
(disclaimer: I have developed some of the DateTime modules)
Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/



Re: Time::Local problem

2004-08-30 Thread Rick Measham
On 31 Aug 2004, at 12:09 PM, Sherm Pendley wrote:
Great - so now our ancestors have to deal with the Y4G bug? ;-)
LOL .. no .. unless you continue to abbreviate. The dates will range 
from 1-01-01 to 1-12-31 and 2004 will mean 2004 not 12004.

Cheers!
Rick
(They're your decedents by the way, your ancestors have stopped 
counting)

Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/



Re: Mac::Glue finder physical size

2004-08-30 Thread Rick Measham
On 31 Aug 2004, at 12:12 PM, Paul McCann wrote:
You need to add a -get after the prop(). Strangely enough I saw this 
by
googling on Mac::Glue physical_size, and the only thing whacked
(modulo close relatives) was your post of 18th March, containing the
vital get. So you want...
LOL .. thanks Paul!
Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/



Re: PerlObjects and OutlineView problems

2004-08-27 Thread Rick Frankel
On Tue, Aug 24, 2004 at 07:03:30AM -0400, Sherm Pendley wrote:
 On Aug 23, 2004, at 5:15 PM, Rick Frankel wrote:
 Short answer: Perl objects can't be used as outline objects.
 
 Long answer: When you pass a Perl object to a Cocoa method, a ObjC 
 stand-in is created, but not retained. Ordinarily, if the receiving 
 object needs access to it later, it retains the passed-in object. 
 NSOutlineView doesn't follow this cardinal rule of Cocoa memory 
 management - it needs to access the same objects at a later time, but 
 it doesn't retain them itself.
 

Thanks. The long answer is what I was looking for. Is it possible to
instantiate proxy objects (of type NSObject?) in perl and assign them
references to the perl objects which can be dereferenced in the
callbacks, or do I have to either use an NSDictionary as in the
OutlineView example or use e.g, NSStrings containing a key (path) to
the perl object stored in an instance variable?

It's funny that everything but the deferencing the current row
(including the edit callbacks) seem to work properly.

rick


PerlObjects and OutlineView problems

2004-08-23 Thread Rick Frankel
I have created an outline field w/ perl objects as the
items. Everything  works ok until I dereference the items in either a
doubleClick (as in the OutlineView example) or via itemAtRow, at which
point the item is corrupted (the objectForItem value is blanked out
and a Bizarre copy of CODE error is thrown the next time the item is
requested in the objectValeForTableColumn selector. If I do a
$sender-reloadData in the selector everything is fine, but of course
this collapses the outline and looses the selection.

Is this a bug or is there a fundamental reason why perl objects can't
be used as outline items?

tia,
rick



Re: Windows and Camelbones

2004-08-20 Thread Rick Frankel
This is probably for Sherm-

I am trying to open a non-modal NSOpenPanel. As a simple test, I
modified the CamelBones FileViewer:


$openPanel-beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo(
$self-{'_openPath'}, '', $fileTypes, $self,
'openPanelDidEnd:returnCode:contextInfo:', undef
);

When invoked, the panel flashes on screen and disappears. It does not
invoke the end selector.

Is this a bug in my understanding/implementation or camelbones? or
is something else broken (FWIW, OSX 1.3.5)

tia,
rick


Re: PDF::API

2004-06-14 Thread Rick Measham
Nelius,
This post belongs on the [EMAIL PROTECTED] list 
rather than the Mac OS-X Perl list. I've cross posted it there and 
would suggest that you subscribe to that list for all your PDF::API2 
help. It's an active and helpful list.

You need to be calling the methods on objects and not on their class. 
Once you open the PDF, you need to add the page to it rather than just 
adding a page to ... a class.

The following code (from my head so it could be wrong) demonstrates how 
you'd do it:

my $pdf = PDF::API2-open( $path_to_pdf ); # Open a PDF
my $page = $pdf-page( $pdf-pages );  # Add a page at the end
$page-do_something()  # Do stuff to the page
If there's any PDF::API2ers reading this, feel free to correct my code.
Cheers!
Rick


On 15 Jun 2004, at 7:08 AM, Nelius Bresnan wrote:
I'm a Perl novice using the PDF::API package to add stuff to the end 
of a
PDF file. I've RTFMed, I've googled this and I even tried emailing the
author but I'm totally stuck.

I want to use the method PDF::API2::PDF::Page-add($str). At first I 
tried
PDF::API2-page($index). This inserts-and-returns a new page at $index 
and
it works fine. However an attempt to use $page-add($str) gets the 
error
message:
Can't locate object method add via package PDF::API2::Page

So it seems that the scalar returned by PDF::API2-page is not the 
same kind
of object that PDF::API2::PDF::Page-add is supposed to be called on. 
This
surprised me - I expected both 'page' objects to be the same type. But 
I
checked and there is a file /Library/Perl/5.8.1/PDF/API2/Page.pm and 
also a
file /Library/Perl/5.8.1/PDF/API2/pdf/Page.pm so it would appear there 
are
in fact two different kind of page objects. And AFAICT I need the 
other one.

So I tried to create a scalar of type PDF::API2::PDF::Page using its
constructor. But to create that I need an object of type
PDF::API2::PDF::Pages to base it on. The constructor for Pages is
PDF::API2::PDF::Pages-new($pdfs,$parent). But the explanation
(http://cpan.uwinnipeg.ca/htdocs/PDF-API2/PDF/API2/PDF/Pages.html) of 
the
parameters needed for $pdfs and $parent aren't explicit enough for a 
Perl
novice like myself. It says that $parent should point at the file 
context if
we're trying to create a root node. And I think thats what I need to 
do to
add pages onto the end of the PDF file.

I know enough Perl to know that contexts are very important in Perl. 
So I
looked it up in three different manuals but none of them make any 
reference
to a file context. So I'm assuming that context isn't being using in 
the
canonical sense here and that the author simply means a file pointer 
of some
kind.

So I've supplied the $pdf scalar that was returned from
PDF::API2-open('aPDFfile.pdf'). The pod says that $pdfs is the file 
object
(or objects) in which to create the new Pages object. I'm not sure
precisely what it means by that but I think its that this is the file 
that
it'll output to. I want it to output to the same file so I've provided 
the
same $pdf value again. So my attempted construction of a 'pages' object
looks like this:
my $pages = PDF::API2::PDF::Pages-new($pdf, $pdf);

when I run it it craps out giving the message:
Can't locate object method new_obj via package PDF::API2 at
/Library/Perl/5.8.1/PDF/API2/PDF/Pages.pm line 68.
I had a look at the line in question and its pretty hairy stuff. I 
think its
doing something about creating a file outputstream or something like 
that.
It's expecting that there will be a pointer to an object in $_ and I 
think
its the wrong kind of object and consequently it can't find the 
method. But
I'm (way) out of my depth. I think my problem is that my providing the 
wrong
parameters to PDF::API2::PDF::Pages-new. But I just can't understand 
what I
should be giving it. The POD comments are too vague for me. I don't 
get what
I should be providing to it.

thank you.
Nelius Bresnan.

Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Re: CPAN Question

2004-05-27 Thread Rick Measham
G'day Timothy,
You're missing the perl headers. These are installed when you install 
the developers tools (which came with your OS or are available freely 
from Apple's website)

I can't remember which package in particular you need, if you can't 
work it out and don't want to just install everything off the disk, I'm 
sure someone else will chip in shortly with exactly which package it 
is.

Cheers!
Rick Measham
On 28 May 2004, at 11:55 AM, Timothy Bailey wrote:
I've been playing around with CPAN, to get some modules installed. 
Unfortunately, something seems to be not working.  Perhaps it was 
because I tried to install LWP before its dependencies.  Or it could 
be that the CPAN update failed.  But anyway, the make section is 
failing.  Any ideas how I can fix it?

Here is an excerpt:
Error: Unable to locate installed Perl libraries or Perl source code.
It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.
(You get this message, because MakeMaker could not find 
/System/Library/Perl/darwin/CORE/perl.h)
That particular file does not seem to exist.  So maybe there's some 
setting I need to change.

And make returns status 512 often.  Whatever that means. ;)
--
   Tim Bailey   |\/  Of all tyrannies, a tyranny exercised 
for the
[EMAIL PROTECTED]|\/  good of its victims may be the most 
oppressive.
   [EMAIL PROTECTED]   | It may be better to live under robber 
barons
 http://www.moonrise.org than under omnipotent moral 
busybodies.
--'--,--@   The robber baron's cruelty may sometimes 
sleep,
   his cupidity may at some point be 
satiated;
  but those who torment us for our own good will torment us without 
end,
 for they do so with the approval of their own conscience.
 -- C.S. Lewis

Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Re: seperate file

2004-04-29 Thread Rick Measham
On 30 Apr 2004, at 12:20 AM, zunsheng Jiao wrote:
Hi all,
I'm new on perl.
I need to separate a huge file to small files.  It has three columns. 
If first column is a number , use this number as a file name (i. e., 
260.dat and 300.dat for following sample), and then writing column 2 
and columns 3 to this file. Following is a sample such file:

26005000
205300
405500
806000
  1005500
   300 05100
205200
405500
805600
  1005800
Please help.
John
If your data is tab delimited the following will work. If not the split 
line needs to be changed depending on how your data is arranged.

# Go through each line of the data
foreach $line(DATA) {
# Split the line at whitespace
my ($file, $col1, $col2) = split(/\s+/,$line);
	# If there's something in the $file column, it's a new file
	if ($file) {
		# close the current file (but don't die if there is none)
		eval{ close(FILE) };
		# open the new file or die if we can't
		open(FILE, /Users/rickm/Desktop/test/$file.dat) or die(I can't 
open $file.dat: $!);
	}
	# Write the data to the file
	print FILE $col1 . \t . $col2 . \n;
}
# close the latest file:
eval{ close(FILE) };

__DATA__
260 0   5000
205300
405500
806000
1005500
300 05100
205200
405500
805600
1005800


Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


no subject

2004-04-22 Thread Rick Third
unsubscribe


Re: Merging into Address Book

2004-04-21 Thread Rick Frankel
On Tue, Apr 20, 2004 at 10:50:01PM -0500, Ken Williams wrote:

 Say, I built the Address_Book glue and looked through its docs, but I 
 don't see methods to search the database for entries that have certain 
 properties.  Do you know of any way to use the Find functionality, or 
 specify required properties, using the applescript/glue interface?

Here's the script I use for querying my addressbook from mutt.
The output format is specific to the mutt interface,
but the commented out section shows how to get the address info.

rick
 cut here ---
#!/usr/local/bin/perl
use Mac::Glue qw(:glue);
use Mac::Apps::Launch;

my $glue=Mac::Glue-new('Address Book',bundle='com.apple.AddressBook');
my $id=$glue-{ID};
if(!IsRunning($id)) {
LaunchApps($glue-{ID}) or die $^E;
$glue-close($glue-prop('window')) or warn $^E;
}

my $q=shift;
print Querying AddressBook...\n;
my @people=$glue-obj('people')-get;
foreach my $entry (@people) {
my @emails=$entry-prop('email')-get;
next unless @emails;

foreach my $email (@emails) {
my $addr=$email-prop('value')-get;
my $name=$entry-prop('name')-get;
print $addr\t$name\t,$email-prop('label')-get,\n
if $name =~ /$q/ || $addr =~ /$q/;
}
#my($addr)=$entry-prop('address')-get;
#next unless $addr;
#print $addr-prop('street')-get,\n;
#print $addr-prop('city')-get, ;
#print $addr-prop('state')-get, ;
#print $addr-prop('zip')-get,\n;
}
exit 0;


Mac::Glue and OmniGraffle

2004-03-31 Thread Rick Measham
1. Product plug (sorry Merlyn) - OmniGraffle is by far the best 
development-planning tool I've ever seen. Love it.

2. I'm trying to perl + Mac::Glue it, but after reading through the 
OmniGraffle.pod and Mac::Glue I'm still lost.

The following applescript works:

tell front document of application OmniGraffl
	tell page 1
		make new shape at beginning of graphics with properties 
{text:{alignment:left, text:field}, origin:{20, ypos}, size:{150, 20}, 
magnets:{{-1, 0}, {1, 0}}}
	end tell
end tell

However, I can't work out the Mac::Glue for the same. I've tried many 
variation on the following but I'm still lost. I've also looked through 
the archives for an example of a $obj-make but all the examples appear 
to be aimed at retrieving data rather than creating 'things'.

use Mac::Glue;
my $OmniGraffle = new Mac::Glue 'OmniGraffle';
my $chart = $OmniGraffle-obj(document = 1, page = 1);
$chart-make(
	new = 'shape', # $chart-obj('shape'))
	at = Mac::Glue::location(before = $chart-obj('graphics')),
	with_properties = {
		origin = [20,20],
		size   = [150, 20],
		text   = {
			text= 'Square'
		}
	},
	ERRORS = \error_handler, # error handler from the perl website 
article
);
__END__

unfortunately, the error message isn't that helpful .. OSA's fault I 
figure: they never make any sense!

OmniGraffle-make(DOBJ, Mac::AEObjDesc=HASH(0xaf398c), new, shape, 
with_properties, HASH(0xaf3878), at, AEDesc=SCALAR(0xaf39bc)) event 
failed:
dsLineFErr (10)
line  trap error




Re: Getting the size of a folder with Mac::Glue

2004-03-18 Thread Rick Measham
On 18 Mar 2004, at 6:06 AM, Chris Nandor wrote:
This works:

  my $obj = $finder-obj(folder = '/Users/pudge/Movies');
  my $size = $finder-data_size($obj);
Chris, what is the data_size?

The correct size of the folder is (from Finder info) 8.6MB on disk 
(4,001,454 bytes)

rickm% perl -e 'use Mac::Glue; $finder=new Mac::Glue Finder; print 
$finder-data_size( $finder-obj( folder = $ARGV[0] ) )' 
/path/to/folder

442

rickm% perl -e 'use Mac::Glue; $finder=new Mac::Glue Finder; 
$obj=$finder-obj( folder = $ARGV[0] ); print 
$obj-prop(physical_size)-get' /path/to/folder

9088512

Which is 8.667MB, the size I'm looking for.

Cheers!
Rick
Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Urgent: Turning a script into a droplet

2004-03-15 Thread Rick Measham
Need some quick help ... how do I turn a perl script into a droplet 
(and when I do, do the dropped files appear in @ARGV still?)

Cheers!
Rick
Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Re: Urgent: Turning a script into a droplet

2004-03-15 Thread Rick Measham
On 16 Mar 2004, at 4:34 PM, Sherm Pendley wrote:
DropScript. http://www.wsanchez.net/software/
On 16 Mar 2004, at 4:16 PM, Andrew M. Langmead wrote:
One suggestion would be DropScript http://www.wsanchez.net/software/ 
It can turn any script or program into a droplet. (by dropping the 
script or program onto it. It itself is a droplet)
Thanks for the suggestion .. looks good.

Cheers
Rick
Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Getting the size of a folder with Mac::Glue

2004-03-15 Thread Rick Measham
I'm trying to get the size of a folder and figure Mac::Glue would be 
the way to go. However I'm getting back a 0:

use Mac::Glue;
my $finder = new Mac::Glue 'Finder';
die(No such file: $monthdir/$folder/) unless -e $monthdir/$folder/;
my $size = $finder-data_size($monthdir/$folder/);
print $size;
# 0
print $MacError
#
Now surely if the file doesn't work (like if I'm supposed to put some 
object there) I should be getting some sort of error?

(If there's a better way to get the size of a folder, please let me 
know!)

Cheers!
Rick


Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Re: ANNOUNCE: Affrus 1.0 - a Perl Debugger

2004-03-11 Thread Rick Measham
Mark, thanks for this announcement. There is no other place on the net 
that would have let me know about this tool. I'll go and check it out 
now.

Randal said:
I will stand by my statement that the posting is wrong until one or
both of those entities have declared contrary ground rules, and
continue to object to such postings until being told otherwise by
someone with authority.
Randal: They have already declared such a post to be allowable. Where 
did they do that? When Ask set up spam filters on the machine in the 
TPF owned domain:

On 12 Mar 2004, at 4:40 AM, Mark Alldritt wrote:
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
x1.develooper.com
X-Spam-Status: No, hits=-4.9 required=8.0 tests=BAYES_00 autolearn=ham
	version=2.63
So, if they didn't want this, surely it would have scored at least in 
the positives! Get over it Randall, this is the best place to post it.

Cheers!
Rick Measham


Senior Developer
PrintSupply - Print Procurement  Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/


Re: Mac::Carbon install problem (Processes.t)

2004-02-16 Thread Rick Measham
There are others who will certainly know better than I do, however let 
me ask, are you running CPAN with:
   sudo /full/path/to/perl -MCPAN -e shell
If you don't use sudo (or su to root if you have it enabled) then there 
will be problems with installs, and if you have your own perl installed 
you'll need the full path to it.

That's just my thoughts, given the 'super-user' related errors.

Cheers!
Rick
On 17 Feb 2004, at 1:54 PM, Salvatore Denaro wrote:
The only thing in the system log that looks like there may be a 
problem is:

aped[185]: Attach denied: super-user process, for 
UserNotification[5049]
aped[185]: Attach denied: super-user process, for perl[5050]
aped[185]: Attach denied: super-user process, for perl[5058]

Anyone know what's wrong?

Thanks.



Re: [OT] XML in SQL (was: MySQL for Web Apps)

2004-02-05 Thread Rick Measham
On Wed, 4 Feb 2004, Rick Measham wrote:

I'd love to see an XML parser embedded into SQL so that I can have:
CREATE TABLE aTable (id serial, data XML);

On 5 Feb 2004, at 05:21 pm, Chris Devers replied:
Does this help?
snip

Is this along the lines of what you were hoping for?
Thanks Christ, but not really at all. What I want is the ability to use 
XML as a data type so that I can have a field full of XML that is 
searchable. The output would be the'zactly the same as current output. 
The input would be XML as a string:

 INSERT INTO data (id, user, data) VALUES (1, 
'rick','usernameRick/namesurnameMeasham/surname/user');
 INSERT INTO data (id, user, data) VALUES (2, 
'rick02','usernameRick/namesurnameSmith/surname/user');

# And then I could retrieve it:

 SELECT * FROM data WHERE data:user:name='Rick'

id |  user  |  data
---
 1 | rick   | usernameRick/namesurnameMeasham/surname/user
 2 | rick02 | usernameRick/namesurnameSmith/surname/user
(2 rows returned)
Cheers!
Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: [OT] XML in SQL (was: MySQL for Web Apps)

2004-02-05 Thread Rick Measham
On 6 Feb 2004, at 01:47 pm, Rick Measham wrote:
Thanks Christ,
erm .. sorry .. chris ..

Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: [OT] XML in SQL (was: MySQL for Web Apps)

2004-02-05 Thread Rick Measham
On 6 Feb 2004, at 02:37 pm, Chris Devers wrote:
Anyway, it was pointed out to me in a different offlist response that I
was probably answering the wrong question. Oh well -- it still seems 
like
a useful (and under-publicized?) capability of the standard MySQL 
client,
so maybe bringing it up will still be of use to someone...
Very true .. I'm a PostGreSQLer rather than a MySQLer, and looking 
through the mailing lists there it looks like theres been talk of 
accessing the XML as data rather than as text ... h.. Feb 2003 .. I 
might poke some people!

Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: [OT] MySQL for Web Apps

2004-02-03 Thread Rick Measham
On 4 Feb 2004, at 03:16 pm, Bill Stephenson wrote:
As computers keep getting faster, and memory and storage cheaper,  
isn't it beneficial to program in the most simple, human readable,  
least learning required, method?
Never. You're not going to ever read each 2500 user's 2000 x 40kb  
records thus it's better to store it in a way that the computer can  
access it.


In short, I'm lazy. I'd rather code this all in perl. Do I really need  
to learn about and use MySQL or will computers get fast enough that it  
won't matter anyway.
Once again, no. Especially with where you're starting. 3 users and you  
might be OK. Have a think about this:
You have a file:
XMLuserid1/idnameBob/name/useruserid2/ 
idnameNancy/name/user/XML

The first thing you're going to do with XML::Parser is turn the XML  
into a perl data structure:
@data = (
 {  id = 1,
   name = 'Bob'
 },
 {
   id = 2,
   name = 'Nancy'
 }
);
Then you'll look through each element of the list looking for name eq  
'Bob'. All you'll do all that in perl. Multiply the files by 2500 users  
then multiply by 40k of information. Perl wouldn't even be able to  
start to store it all.

On the other hand if you store the data directly in a database which  
has been optimised for quick searching and already has all the methods  
you'll ever require to store and retrieve data, you'll be running it as  
a compiled program. It will run a LOT faster and it will do it's job a  
LOT better.

It will also handle data-locking so you and I can't both be writing to  
a file at the same time.

In short there's no question about which is the better option.  
Databases are quicker and safer.

Cheers!
Rick


Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: [OT] MySQL for Web Apps

2004-02-03 Thread Rick Measham
On 4 Feb 2004, at 03:39 pm, kynan wrote:
The idea of having XML in the DB is sound though, if you do it 
thoughtfully.
So long as you're not planning on searching on it or indexing it or ...

I once used XML to store information about a webpage as a PostGreSQL 
field ... but later down the track I wanted to search on some of that 
data and had to retrieve all records that contained 'bob' and then 
parse the XML and check that 'bob' was in the byline rather than just 
having his name in the content.

dream

I'd love to see an XML parser embedded into SQL so that I can have:
CREATE TABLE aTable (id serial, data XML);
Then I can:
SELECT id FROM aTable WHERE data:story:byline = 'Bob';
Which would return the id of any record whose data field looked 
something like:
XMLstory 
id=1bylineBob/bylinecontentContent/content/storystory 
id=2bylineBob/bylinecontentContent of another 
story/content/story/XML

But wouldn't return the id where the data looked like:
XMLstory id=1bylineNora/bylinecontentBob is a 
dude/content/storystory id=2bylineBill/bylinecontentContent 
of another story/content/story/XML

even though 'bob' is in the text.

Basically the SQL engine would recognise that 'data' is an XML field 
and could search it according to requirements.

/dream

Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: permission denied during open

2004-02-01 Thread Rick Measham
On 2 Feb 2004, at 12:59 am, timothy driscoll wrote:
this fails with an error 'Permission denied' when the target dir 
'temp' looks
like this:

drwxrwxr-x  3 nobodynobody   102  1 Feb 08:44 temp

but it works if I make the dir writeable by everyone:

drwxrwxrwx  3 nobodynobody   102  1 Feb 08:44 temp

I thought perl ran as nobody, so giving r/w access to 'nobody' should 
work.
but obviously it doesn't - so what did I do wrong?
G'day Tim,

perl itself will run as whoever calls it. In the case of CGI it will be 
run by Apache or whichever http server you're running.

By default apache used to run as 'nobody.nobody', then on some installs 
it runs as 'apache.apache'. However, on MacOS-X it runs as 'www.www'. 
Check the httpd.conf file to see (It's the 'user' and 'group' 
directives).

Assuming you're on OS-X, set your file's owner.group to www.www and you 
should be fine with a 744.

Cheers!
Rick


Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: permission denied during open

2004-02-01 Thread Rick Measham
OK, I'm a git. I didn't scroll down so I didn't realise this had 
already been answered half a dozen times. Sorry!

On 2 Feb 2004, at 10:32 am, Rick Measham wrote:

On 2 Feb 2004, at 12:59 am, timothy driscoll wrote:
this fails with an error 'Permission denied' when the target dir 
'temp' looks
like this:

drwxrwxr-x  3 nobodynobody   102  1 Feb 08:44 temp

but it works if I make the dir writeable by everyone:

drwxrwxrwx  3 nobodynobody   102  1 Feb 08:44 temp

I thought perl ran as nobody, so giving r/w access to 'nobody' should 
work.
but obviously it doesn't - so what did I do wrong?
G'day Tim,

perl itself will run as whoever calls it. In the case of CGI it will 
be run by Apache or whichever http server you're running.

By default apache used to run as 'nobody.nobody', then on some 
installs it runs as 'apache.apache'. However, on MacOS-X it runs as 
'www.www'. Check the httpd.conf file to see (It's the 'user' and 
'group' directives).

Assuming you're on OS-X, set your file's owner.group to www.www and 
you should be fine with a 744.

Cheers!
Rick


Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf
Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: tricky parsing question

2004-01-22 Thread Rick Measham
On 23 Jan 2004, at 01:21 pm, wren argetlahm wrote:

I'm working on a linguistic module and I'm trying to
find a good way to split a string up into segments.
I can't assume single charecter strings and want to
assume maximal segments. As an example, the word
church would be rendered as the list ('ch', 'u',
'r', 'ch') and wouldn't break the ch up smaller even
though both c and h are valid segments in English.
I have all the valid segments for a given language
stored as keys in a hash, now I just need an algorithm
to chop up a string into a list. Any ideas?
Wren, when you say 'segments' it appears you mean phonemes or phonetics.

CPAN has several modules that may help you:

Lingua::Phoneme uses the Moby Pronounciation Dictionery to find the 
phonemes.

Text::Metaphone also deals with phonemes and will return 'Church' as 
'XRX' meaning 'ch', 'r', 'ch'. Unfortunately it returns the 'ch' in 
'Character' as an 'X' also.

And that, of course, is the most difficult part. English is such a 
hodge-podge of hacks from other languages the understanding it via 
algorithms is very very hard.

Cheers!
Rick


Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: ***regular expression*** weird

2004-01-19 Thread Rick Anderson
I should apologize for the response I sent. For some reason, the 
original post was showing in my mailbox as today so I responded. Now 
it's showing up as having shown up Nov. 14, 2003 and I see several 
responses from back then! Bizarre. My apologies for any confusion that 
may have caused.

--Rick Anderson
The only difference between me and a madman,
is that I am not mad. -- Salvador Dali


Re: ***regular expression***

2004-01-18 Thread Rick Anderson
On Friday, November 14, 2003, at 07:25  AM, xweb wrote:

Can someone help me about a regular ?
In which way i can substitute a href=$urlstring/a with
idlink$val1.
I'm not sure I understand exactly what you're asking. Do you mean you 
want to take the value of $url and place it where $val1 occurs in the 
substitution string? If that's what you mean, then surround the part of 
the regex that you want to retain in parentheses and recall it using 
the $1 ... $9 variables.

Like this:

$test = a href=\http://www.google.com\;Google/a;

$test =~ s/a 
href=\(http:\/\/www\.google\.com)\Google\/a/idlink\1/;

print $test;
# test = idlinkhttp://www.google.com;


--Rick Anderson
The only difference between me and a madman,
is that I am not mad. -- Salvador Dali


Getting a 'Save As' dialog box

2004-01-11 Thread Rick Measham
Hello People,

I need some help with a perl on OS-X problem. I need to pop up a 'Save 
As' dialog. Basically the same as the one AppleScript gives you when 
you:
	choose file name with prompt Select a location to save this file 
default name Name

but I need to do this from perl. At first I thought it might be simple:
	$file = `osascript -e 'choose file name with prompt test1 default 
name test2'`;
but that gives me: 0:57: execution error: No user interaction allowed. 
(-1713)

So next I used CPAN module Mac::AppleScript and I don't get any reply 
at all:
	RunAppleScript(qq(choose file name with prompt test1 default name 
test2));

But I figure that somewhere in all this there must be a way to pop up 
such a dialog directly from perl.

How?

Thanks and Cheers!
Rick




Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: Getting a 'Save As' dialog box

2004-01-11 Thread Rick Measham
Thanks John,

Works a treat!



On 12 Jan 2004, at 03:47 pm, John Delacour wrote:

At 2:51 pm +1100 12/1/04, Rick Measham wrote:

 I used CPAN module Mac::AppleScript and I don't get any reply at all:
RunAppleScript
Further to my last posting, I discover that some applications will not 
behave properly if the tell target is themselves.  Eudora and BBEdit 
6.5 are two examples of apps that hang, but you can run this from the 
Terminal or you can run it from the Terminal with Terminal as the 
target.  It will also work fine with tell self in certain other apps.

#!/usr/bin/perl
use Mac::AppleScript qw(RunAppleScript);
my $asresult  = RunAppleScript EOS;
tell app Eudora
  activate
  choose file name with prompt test1 default name test2
  posix path of result
end
EOS
print \n$asresult\n
Rick Measham
Senior Designer and Developer
Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf


Re: Getting my WAN IP address from ppp0

2004-01-06 Thread Rick Smith
Hi Zach,

Well, this almost works for me.

 #!perl
 my $ifconfig = `ifconfig`; # the ifconfig command gives the current 
 network information
 $ifconfig =~ /inet (\d+\.\d+\.\d+\.\d+)/; # extract the ip address 
 with a regular expression
This does extract my IP address, but the one for the loopback device 
lo0. The ifconfig output looks like this:

lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 16384
 inet6 ::1 prefixlen 128
 inet6 fe80::1 prefixlen 64 scopeid 0x1
 inet 127.0.0.1 netmask 0xff00
gif0: flags=8010POINTOPOINT,MULTICAST mtu 1280
stf0: flags=0 mtu 1280
en0: flags=8863UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST mtu 1500
 tunnel inet  --
 ether 00:30:65:ef:a8:f0
 media: autoselect (10baseT/UTP half-duplex) status: active
 supported media: none autoselect 10baseT/UTP half-duplex 
10baseT/UTP full-duplex 10baseT/UTP full-duplex,hw-loopback 
100baseTX half-duplex 100baseTX full-duplex 100baseTX 
full-duplex,hw-loopback 1000baseTX full-duplex 1000baseTX 
full-duplex,hw-loopback 1000baseTX full-duplex,flow-control 
1000baseTX full-duplex,flow-control,hw-loopback
fw0: flags=8822BROADCAST,SMART,SIMPLEX,MULTICAST mtu 2030
 tunnel inet  --
 lladdr 00:30:65:ff:fe:ef:a8:f0
 media: autoselect full-duplex status: inactive
 supported media: autoselect full-duplex
ppp0: flags=8051UP,POINTOPOINT,RUNNING,MULTICAST mtu 1492
 inet 212.212.2.212 -- 212.128.128.12 netmask 0xff00

If you want the ip address of PPPoE connection, change the first line of the script to 
 my $ifconfig = `ifconfig ppp0`;
 
HTH,
Rick Smith


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: segmentation fault when searching for repeated text

2002-11-12 Thread Rick Frankel
On Wed, Nov 13, 2002 at 02:31:03PM +0800, Peter N Lewis wrote:
 The following code ends up with an error (segmentation fault):
 
  $_ = 'x' x 1000;
  /(a.|.){2,}/o;
 
 The segmentation fault seems to happen only when the searched text 
 ($_ in this example) is longer than 855 characters.

 Yep, the same thing happens in perl 5.8.0 under Mac OS X 10.2.1, 
 except it happens when it is longer than 927 characters.
 
 Looks like quite a robust bug.  I wonder if it is even Mac OS X specific.

Nope. Happens at different lengths on 2 debian linux boxes:
 
 unstable w/perl 5.8.0,  4502
 stable w/perl   5.6.1  30830

Quite a difference there! 

rick



Re: FYI: Successful Install of Perl 5.8.0 RC 1 + Apache 2.0.36 + ModPerl-2.0 on OSX 10.1.4

2002-06-07 Thread Rick Frankel

On Fri, Jun 07, 2002 at 09:29:40AM -0400, Chris Nandor wrote:
 In article p05111a37b9248135ce12@[203.47.34.3],
  [EMAIL PROTECTED] (Peter N Lewis) wrote:
 
  At 18:57 -0400 5/6/02, Rick Frankel wrote:
  
  so, adding:
   .PHONY: install
  
  at the top of the (gnu)makefile will force the install target to
  execute.
 .PHONY is not just a GNU make thing anyway; I know dmake uses it (we use 
 it in the MacPerl Makefile, which uses dmake), so that makes it even 
 less likely.  There are also multiple .PHONY declarations in perl's 

FWIW, i think it was first used in gnu make. I know it's not in the
old Feldman make or /usr/ccs/bin/make on solaris.

 Makefile.SH already, including one for the install target, so I 
 imagine it is used on other *make, too.  From my generated Makefile on 
 Linux:
 
 .PHONY: install install-strip install-all install-verbose install-silent 
 \
 no-install install.perl install.man install.html
 
 
 So I dunno what the deal is ... maybe the problem is that .PHONY is a 
 no-op on Mac OS X's make?

Curious. I just tried a test on OSX w/ /usr/bin/make (linked to
/usr/bin/gnumake) AND /usr/bin/bsdmake and .PHONY: install works.


rick



Re: FYI: Successful Install of Perl 5.8.0 RC 1 + Apache 2.0.36 + ModPerl-2.0 on OSX 10.1.4

2002-06-05 Thread Rick Frankel

On Wed, Jun 05, 2002 at 08:14:00AM +0800, Peter N Lewis wrote:
 At 14:05 -0700 4/6/02, Alex S wrote:
 If you want a more general solution than Perl changing the name of 
 the files to *.txt (which would mnake sense anyway as someone else 
 pointed out), then i think  changing make is far more likely than 
 changing Apple's file system.  What about updating make to deal with 
 the difference between a file called INSTALL and a tag install rather 
 than just blindly using the file system.
 
 Heck, even a special case for install/INSTALL would resolve a lot of 
 problems - perhaps even just a special build for Mac OS X that dealt 
 with the issue.

Another approach (for gnu make). From make.info:

Phony Targets
=

   A phony target is one that is not really the name of a file.  It is
just a name for some commands to be executed when you make an explicit
request.  There are two reasons to use a phony target: to avoid a
conflict with a file of the same name, and to improve performance.

   If you write a rule whose commands will not create the target file,
the commands will be executed every time the target comes up for
remaking.  Here is an example:

 clean:
 rm *.o temp

Because the `rm' command does not create a file named `clean',
probably
no such file will ever exist.  Therefore, the `rm' command will be
executed every time you say `make clean'.

   The phony target will cease to work if anything ever does create a
file named `clean' in this directory.  Since it has no prerequisites,
the file `clean' would inevitably be considered up to date, and its
commands would not be executed.  To avoid this problem, you can
explicitly declare the target to be phony, using the special target
`.PHONY' (*note Special Built-in Target Names: Special Targets.) as
follows:

 .PHONY : clean

Once this is done, `make clean' will run the commands regardless of
whether there is a file named `clean'.

   Since it knows that phony targets do not name actual files that
could be remade from other files, `make' skips the implicit rule
search
for phony targets (*note Implicit Rules::).  This is why declaring a
target phony is good for performance, even if you are not worried
about
the actual file existing.

   Thus, you first write the line that states that `clean' is a phony
target, then you write the rule, like this:

 .PHONY: clean
 clean:
 rm *.o temp

--

so, adding:
.PHONY: install

at the top of the (gnu)makefile will force the install target to
execute.

rick



Re: About testing cgi at command line

2002-04-12 Thread Rick Frankel

On Fri, Apr 12, 2002 at 10:59:19AM -0700, Alex S wrote:
 Just press Control-D to skip that.  I believe there's a way to disable 
snip/
 I've never been clear as to what toggles this to be on or off, but I'm 
 guessing it's some flag in CGI.pm.

It's related to the installed version of CGI.pm, from the changelog:

Version 2.57

   1. Added -debug pragma and turned off auto reading of STDIN.

BTW, you can pass args on the command line, e.g.: 

perl cgitest.pl x=y z=a

so, my customary approach (prior to the current CGI.pm releases) was to 
simply pass a dummy param assignment on the command line.


rick



Re: Upgrade to cgi 2.57 or beyond?

2002-04-12 Thread Rick Frankel

On Fri, Apr 12, 2002 at 11:41:53AM -0700, drieux wrote:
 
 Just found out that the webServer and the OSX box are running 2.56
 while my linux and solaris boxes I thwacked over to 2.752
 
 so should I just pull the source over and do the
 
   make *.PL
   make
   make test
   make install
 
 or.

Since the current version is 2.81, i would suggest: 
 
 sudo perl -MCPAN -e 'install CGI' 
 
rick 



more security update woes

2002-04-11 Thread Rick Frankel

Tangential to the mod_perl issue, has anyone else noticed that 
~/.MacOSX/environment.plist is no longer being parsed on login after 
the security update?

rick




Re: Perl/Tk on Mac os X

2002-04-03 Thread Rick Frankel

On Wed, Apr 03, 2002 at 09:57:48AM -0500, aaron wrote:
 Hi All,
   Does anyone have any updated information on perl/Tk for OS X?  Most of my 
 stuff at work uses perl/Tk and I was over-joyed to install Tk on my Mac.  To 
 my chagrin it crashes exactly like described below.  Is there an OS X 
 -compatible version available now?  Does anyone know what causes this 
 problem?  I'm assuming it's a C thing...

Whoops. I guess I should have followed up on this...

Anyway, via macintouch comes this link:

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

the short of it is that -03 optimization breaks perl/tk. Here's the 
relevant excerpt from the above on the solution:

*  Install the modified dynamic loader per 
http://www.lehigh.edu/Macintosh/X/ptk/dyld-tk.
* Now compile Tk800.023. The caveat: you cannot use -O3, which is the default, 
determined from how Perl itself was compiled. Here's the trick as described by Michael 
Doster (who made the dyld mods described above):

Under the pTk source directory edit the file Tk/MMutil.pm.
In the subroutine cflags make the following change at the end:

 $_ .= \nOPTIMIZE=\n;
 $_;
} # end subroutine cflags.


BTW, personally tested and used (I can't live w/o -d:ptkdb :)

rick





Re: mod_perl Chart.pm

2002-02-27 Thread Rick Frankel

On Wed, Feb 27, 2002 at 08:51:26AM -0900, hcir wrote:
 i have mod_perl working with a number of scripts and Apache. i have a 
 script using Chart.pm to return a graphic which works when using perl 
 but when i use it under mod_perl my browser displays the text 
 representation of the graphic (using $g-cgi_jpeg(\@data);)
 
 any ideas on what i need to do differently?

I'm not familiar w/ Chart.pm, but my guess would be that the content-type is
not getting set to image/jpeg under mod_perl, and is defaulting to text/html.

rick




Re: psync fails with 5.7.2

2002-02-05 Thread Rick Frankel


On Tuesday, February 5, 2002, at 12:39 PM, Randal L. Schwartz wrote:


 So what is everyone using that they can actually *use* it here? Curious.
 5.6.1 perhaps?

Running 5.6.1 here, but I think it may be a permission problem in the 
distrib directory,
The test scripts should probably copy, etc. in /tmp instead of the 
current tree.
transcript below
I did something like:
sudo  'perl -MCPAN -eshell'
 install MacOSX::File

OK
  quit

Now, as verfied
sudo -s
# cd ~/.cpan/build/MacOSX-File-0.61
# ls -l

-rw-r--r--1 root 1000 1689 Jan 28 02:44 File.pm

# make test

PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib 
-I/System/Library/Perl/darwin -I/System/Library/Perl -e 'use 
Test::Harness qw(runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/catalogok
t/copy...ok
t/file...ok
t/info...ok
t/spec...ok
All tests successful.

# exit
$ make test

PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib 
-I/System/Library/Perl/darwin -I/System/Library/Perl -e 'use 
Test::Harness qw(runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/catalogdubious
 Test returned status 0 (wstat 11, 0xb)
DIED. FAILED tests 3-7
 Failed 5/7 tests, 28.57% okay
t/copy...NOK 2-5000 at t/copy.t line 20.
t/copy...NOK 3-5000 at t/copy.t line 21.
Use of uninitialized value in numeric eq (==) at 
blib/lib/MacOSX/File/Copy.pm line 146.
t/copy...NOK 4-43 at t/copy.t line 22.
Use of uninitialized value in numeric eq (==) at 
blib/lib/MacOSX/File/Copy.pm line 146.
t/copy...NOK 5-43 at t/copy.t line 23.
t/copy...FAILED tests 2-5
 Failed 4/5 tests, 20.00% okay
t/file...ok
t/info...NOK 6/Developer/Tools/GetFileInfo: could not refer to file 
(-43)
Use of uninitialized value in string eq at t/info.t line 37.
t/info...FAILED tests 6-7, 9-10
 Failed 4/10 tests, 60.00% okay
t/spec...ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
t/catalog.t011 75  71.43%  3-7
t/copy.t   54  80.00%  2-5
t/info.t  104  40.00%  6-7 9-10
Failed 3/5 test scripts, 40.00% okay. 13/29 subtests failed, 55.17% okay.

$ sudo chown -R rick .
$ make test

PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib 
-I/System/Library/Perl/darwin -I/System/Library/Perl -e 'use 
Test::Harness qw(runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/catalogok
t/copy...ok
t/file...ok
t/info...ok
t/spec...ok
All tests successful.




Re: Apache::args vs Apache::Request speed

2002-02-01 Thread Rick Frankel

On Fri, Feb 01, 2002 at 03:23:19PM -0500, Joe Schaefer wrote:
 Ian Ragsdale [EMAIL PROTECTED] writes:
 
   I hope a new release will be just around the corner, but if you want
   to test out some of the latest stuff, have a look at
   
   http://www.apache.org/~joes/
 
 
 Would someone PLEASE volunteer to try to compile and test
 apache+mod_perl  libapreq on OS/X using the experimental
 code I posted there?  Even if you can't get it working,
 ANY feedback about what happened when you tried would be 
 VERY helpful.

Compiling as i write this :^}. If anyone else would like to send me a
small handler which demonstrates the problem, it would be appreciated.

BTW, does anyone know if the expat conflict is (no-longer) a problem
on osx? just in case I'm using --disable-rule=EXPAT.

rick



MacOSX Requests and Cookies

2002-02-01 Thread Rick Frankel

Ok.

Here's the output of localhost/perl-status?inc (elided)

Embedded Perl version v5.6.1 for Apache/1.3.23 (Darwin) mod_perl/1.26 
process 2729,
running since Fri Feb 1 19:25:53 2002
Package Version Modified File
Apache 1.27 Tue May 1 13:11:20 2001 
/usr/local/apache/perl/darwin/Apache.pm
snip/
Apache::Cookie 1.0 Sun Jan 20 12:19:24 2002 
/usr/local/apache/perl/darwin/Apache/Cookie.pm
Apache::Request 1.0 Sun Jan 20 12:19:02 2002 
/usr/local/apache/perl/darwin/Apache/Request.pm

This is with a statically linked mod_perl. It doesn't crash, but in my 
(minimal) testing, it seems that Apache::Cookie is a no-op. I can't seem 
to get it to set or retrieve any cookies, it fails silently.

Joe- ApacheCookie_* was not being boostrapped into the executable, so it 
was being optimized of the linkage.

The following patch, while probably not correct (and probably the cause 
of the silent failure), covers it.

--- http_main.c Fri Feb  1 19:22:51 2002
+++ http_main.c~Mon Jan 28 04:07:46 2002
@@ -7805,12 +7805,5 @@
  {
  return ApacheRequest_new(r);
  }
-/*RAF*/
-#include apache_cookie.h
-ApacheCookie *suck_in_apcookie(request_rec *r);
-ApacheCookie *suck_in_apcookie(request_rec *r)
-{
-return ApacheCookie_new(r);
-}
  #endif /* USE_APREQ */


-END PATCH

Also, the all-in-one compile method doesn't setup apache correctly, so 
the steps taken were:

unpack everthing in the same root directory

mod_perl:

$ perl Makefile.PL APACHE_PREFIX=/usr/local/apache DO_HTTP=1 \
PREP_HTTP=1 USE_APACI=1 EVERYTHING=1
$ make
$ make install

http_apreq:

$ perl Makefile.PL
$ make
$ make install

apache:

$ CFLAGS='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ./configure 
--prefix=local/apache  \
  --enable-shared=max --disable-rule=EXPAT --with-layout=Apache \
--activate-module=src/modules/perl/libperl.a --disable-shared=perl

$ make
$ make install

rick




Re: MacOSX Requests and Cookies

2002-02-01 Thread Rick Frankel

On Fri, Feb 01, 2002 at 10:39:02PM -0500, Joe Schaefer wrote:

 Great -  thanks a ton!
Not so great. I'm half asleep. You need to do patch -r or, apply the
forward patch included below...

rick

--- http_main.c~   Mon Jan 28 04:07:46 2002
+++ http_main.cFri Feb  1 19:22:51 2002
@@ -7805,5 +7805,12 @@
 {
 return ApacheRequest_new(r);
 }
+/*RAF*/
+#include apache_cookie.h
+ApacheCookie *suck_in_apcookie(request_rec *r);
+ApacheCookie *suck_in_apcookie(request_rec *r)
+{
+return ApacheCookie_new(r);
+}
 #endif /* USE_APREQ */



Re: Perl/Tk on Mac os X

2002-01-30 Thread Rick Frankel

On Wed, Jan 30, 2002 at 10:33:21AM -0500, aaron wrote:
 I have followed the same procedure as you and I also get a bus error with 
 menus.  In fact, the widget demo that comes with perl/Tk gives a bus error 
 for almost every part of its interface.  Are we the only two people having 
 this problem?  If so, is there something we can do to fix this?  Most of my 

Nope, you're not. I think this thread has passed this list before. 
It's not just menus, hovering over any gui component causes a crash.

Haven't had time to try and track down the problem though...

rick