22
Hi,
cause I am working more and more with perl again, I run in some problems. I know how frustrating it can be if google returns no results for your problem, I decided to document any too trivial fix here. I’ve set up my MacBook Pro to be the new development box for proftpd_admin with Mac OS 10.6. So I installed apache2, proftpd and mysql5 via MacPorts. And then I ran cpan –I DBD::mysql . But the tests on OS X failed, as follows:
The reason is pretty obvious. So you thread_stack size is too small. This can be configured in you mysql config. If you use Macports, the file should be located in /opt/local/etc/mysql5/ and be named my.cnf. Just edit the line thread_stack in the [mysqld] section. I’ve set the size to 515KB which may be too big. But the test failed with 192KB, too, so I just overshot to be on the save side. After you’ve edited the config, don’t forget to restart mysql.
Bye,
Dennis
Posted by: DP | Add comment
23
I am back with a short tail about Mac OS 10.6 and how apple broke perl. Sorry, but 10.6 shipped with such a mess! Yesterday I intended to write a perl script which should interact with iPhoto via Mac::Glue. But guess what the following command will output:
perl -e "use Mac::Glue;"
I guess nobody thinks that it will not err, so watch (read) the show:
Can't load '/System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/MacPerl/MacPerl.bundle' for module MacPerl: /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/MacPerl/MacPerl.bundle: no appropriate 64-bit architecture (see "man perl" for running in 32-bit mode) at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
at /System/Library/Perl/Extras/5.10.0/Mac/Glue/Common.pm line 21
Compilation failed in require at /System/Library/Perl/Extras/5.10.0/Mac/Glue/Common.pm line 21.
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.10.0/Mac/Glue/Common.pm line 21.
Compilation failed in require at /System/Library/Perl/Extras/5.10.0/Mac/Glue.pm line 7.
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.10.0/Mac/Glue.pm line 7.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Great, isn't it. So perl -V reveals that apple ships a 32bit perl with OS 10.6. So at least the error message tells us where to look (man perl). That will tell us that perl can be convinced to load 32 Bit libraries by setting the variable VERSIONER_PERL_PREFER_32_BIT to yes via
export VERSIONER_PERL_PREFER_32_BIT
Now, it works like it should. So edit your ~/.bashrc to automatically set the variable at startup of bash and you'll be happy.
Bye
Dennis
Posted by: DP | Add comment
21
Hello,
today I want to write about a small nasty bug I hit yesterday while installing DBIx::Class and all of its dependencies. Basically, I just ran the command cpan -i DBIx::Class as root on my Mac OS X (10.6.5) box and waited a little while till it was done. Then I wanted to install DBIx::Class::Schema::Loader also. But suddenly bash informed me when executing cpan as root:
bash-3.2# cpan
bash: /usr/bin/cpan: Permission denied
Great, so something during the install process changed the permissions of /usr/bin/cpan. This would be easily fixable as long as only this is the only file which permissions were changed (accidentally), but who knows what else was changed and maybe broke my perl install. And just as a side note, don't change the standard perl install on OS X, even though its partially horrible broken (see wxPerl as an example), because otherwise some updates may mess up your system. Some OS X internals heavily rely on this broken piece of software. So I remembered that the Disk Utils program had an option to repair permissions which will restore all file permissions of OS X to the install settings. After a successful run I had a fully functional cpan again without any additional handiwork.
Bye
Dennis
Posted by: DP | Add comment
05
Hi,
Padre is becoming an open source IDE for perl which is under heavy development. It is written in Perl with wxwidgets for the GUI. Therefore, it is (almost) platform independent and, as far as I know, the only free perl IDE still being actively developed (no, I neither count vi nor emacs as an IDE, even though you can use it as such). So I tried to installed Padre on my macbook pro. The Padre download pages have detailed instructions on that topic, but for me they never worked. So I’ll document my way, maybe someone else doesn’t need to spend one complete evening to install an IDE.
First of all we need to upgrade wxwidgets because leopard uses version 2.8.4. and Padre requires at least version 2.8.8. Therefore, download a source tarball from here. After extracting the file, run the following commands after changing into the newly created directory
mkdir osx-build
cd osx-build
../configure --prefix=/usr/ --enable-mediactrl --enable-listctrl --with-opengl
make
make install
Now you’ve got an up-to-date version of wxwidgets. The next step is to install some requirements of Wx and Padre. I had to install the following modules before installing Wx because Wx depends on them, but cpan doesn’t resolve the dependency for some unknown reason. So you install the following three modules first:
- Test::Base
- Test::Differences
- ExUtils::CBuilder
Some tests of File::HomeDir failed, therefore I forced the installation in the cpan shell via
force install File::HomeDir
I could not use the newest version of Wx supplied by cpan, because it failed to compile (some XS bugs) and cpan onyl provides the newest version of a module, you need to download an older version, I chose 0.95. Before, installed this version by hand, give cpan a try and even if it fails, all dependencies are installed. Then extract the tar file and change in the newly created directory to run:
perl MakeFile.pl
make
make install
Now I suggest to change you cpan settings so that cpan will stop an installation if an required module does not install.This makes life simpler to track down modules which need to be installed by force. In the last step you need to start cpan witht the wxperl executable which is done by:
wxPerl -MCPAN -eshell
And you can now install Padre. After an successful installation you can start padre via /usr/local/bin/padre. Enjoy it. And here some screenshots of padre 0.66.
Bye
Dennis


