The Perl technocrati seem to live on the three main desktop OS roughly in the order Linux, Mac, Windows. Linux is first mostly because it serves dual purpose as a server platform.
But looking down from the stage at any major Perl conference you are likely to see a sea of Mac laptops, many of them owned by Perl hacker gods.
And yet, Perl on the Mac seems to be nearly abandoned as a platform, or at the very least badly ignored. Mac::Carbon and friends haven't worked reliably for years, Padre installation is by far the hardest to install on Macs, and unlike the ongoing flood of Win32:: releases I rarely see much in the way of code being produced for Mac.
How can this be? How is it that the highest concentration of Perl brilliance we have can't even produce basic platform support and instead seem to always resort to compiling their own Perl.
Mac is the one platform I don't run regularly, and yet I seem to get weekly complaints from Mac people that some of my modules suck because they rely on Mac:: modules. As if that is somehow a bad thing?
Why the hell doesn't anything ever seem to get any better?
What would it take for Perl on the Mac to become less of a cesspit of despair?
Strongly, strongly disagree (Score:1)
You're way off base on this one.
I've been using Mac for Perl dev for about 6-7 years (whenever OS X 10.1 came out) and consider it first class. The Mac:: packages are largely irrelevant -- Carbon is a legacy API from the 90s, about as relevant today as a Win95-specific API would be I suppose. If you used a Win95:: library, you'd get similar complaints from users of a modern Windows OS.
The "flood" of Win32:: packages is because you need those platform-specific hacks to get anything done on Windows Perl. N
Re: (Score:1)
I see this most because of File::HomeDir.
So tell me this, without using any Mac:: modules, where is your documents directory?
Re: (Score:1)
~/Documents
Re: (Score:1)
Let me rephrase, where is everybody's documents directory?
Re: (Score:1)
In Cocoa, the correct answer according to Stack Overflow is:
NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
Re: (Score:1)
No, not NSLibraryDirectory. It's NSDocumentDirectory. From XCode docs:
Re: (Score:2)
File::HomeDir, for the Mac, requires Mac::Files which is unfortunately bundled with Mac::Carbon. The latter does not and will never run on a 64-bit Perl, but that's the direction we're going. Because Bundle::CPAN requires File::HomeDir, a fresh Perl installation on a Mac is very painful if you have a 64-bit Perl. I had to manually install File::HomeDir after locally patching it to work around the Mac::Files pain.
Re: (Score:1)
Then build me a Cocoa replacement and I'll link to that instead
Re: (Score:2)
But you don't need Cocoa or Carbon just to have File::HomeDir functionality, do you? Or am I missing something?
Re: (Score:1)
See my previous comments.
The location of your "Documents" directory can only be determined via a system call. You cannot assume ~/Documents in all cases.
This is the reason that we use Mac::Files in the first place.
Re: (Score:1)
This argument has become so tiresome, though. Are there any examples of any real installation where the natural constant values of "user homedir from getpw*" followed by, say, Documents, are wrong?
I can accept that to be 100% accurate to the spec, you must ask the Cocoa layer, but since there is no way to change these values, it's fairly absurd to demand that we will simply make it harder to use a Mac than another unix box. It would be nice to have a Cocoa-based directory checker, but without it, nothing
rjbs
Re: (Score:1)
Re: (Score:2)
Here's a patch to fallback ~/Documents and a like if Mac::Files is not available
http://gist.github.com/198459 [github.com]
It also fixed the bug in darwin.t where it skips the whole tests if you have multiple users.
Re: (Score:2)
Re: (Score:2)
Ovid, no, you're significantly wrong.
First, let me correct what Alias said: Mac::Carbon has always worked reliably. It has not always INSTALLED reliably, due to changes that break both compiling and testing.
Second, as to Mac::Files specifically, you cannot separate it from Mac-Carbon. There is no reason to do that: the same reasons why much of Mac-Carbon as a whole won't run on 64-bit perl, is the same reason why Mac::Files also won't. In fact, Mac::Files probably has more incompatibilies with 64-bit tha
Re: (Score:2)
Hi Adam!
http://pudge.net/tmp/Darwin.tar.gz [pudge.net]
Re: (Score:2, Informative)
and a simple Cocoa implementation. Only tested on 10.5.
http://idisk.mac.com/christian.hansen/Public/perl/Mac-SystemDirectory-0.01.tar.g z [mac.com]
perl -MMac::SystemDirectory=:all -wle 'print FindDirectory(NSDocumentDirectory);'
/Users/chansen/Documents
--
chansen
Re: (Score:2)
chansen, this looks awesome: works fine on 10.5 and 10.6.
Updated my patch to use Mac::SystemDirectoty on 64bit perl, Carbon in 32bit and then fallback to pure perl: http://gist.github.com/198615 [github.com]
Re: (Score:2)
Now committed to http://svn.ali.as/cpan/trunk/File-HomeDir [svn.ali.as] as r9436 and r9437.
MSWin, testing, and perl surviving (Score:1)
It seems to me that testing by smokers is also in the order Lunix, Mac, MSWin. That is pretty strange to me, if we want perl to be nice to novices, and we want perl to grow and thus live.
Maybe it should be a goal for Strawberry Perl to be able to be shipped with cpan testing on, so anyone who can type "cpanp" at the MS command window (not many, I wager) will be a tester of everything they think they need. If they want to turn it off, the directions will be right there.
The major problem I see is only an em
I use my Mac as if it were a Linux box... (Score:1)
Re: (Score:2)
the huge and mostly busted Mac::Carbon
Which parts of Mac::Carbon are busted? Just curious. :-)
Re: (Score:2)
Actually, even then, it's been fine for most people. It's just a few tests that were busted. Nothing preventing you from installing it.
Re: (Score:2)
Failing tests prevent you from installing it
Bah.
Re: (Score:2)
Unfortunately this ends up putting .cpan in a directory that contains spaces, which tends to break a lot of module tests and compiles, since most tests are written as though unix was the only filesystem
Does Unix not support spaces in filenames?
There might be a problem in tests, but it's not because they assume they're running on "the unix filesystem" (whatever that is).
--
Esli epei eto cumprenan, shris soa Sfaha.
Aettot ibrec epesecoth, spakhea scrifeteis.