PerlWrapper 0.3

This is an early release of PerlWrapper. Use at your own risk.
PerlWrapper has been tested on Mac OS X 10.4, (“Tiger”), 10.5 ("Leopard") and 10.6 ("Snow Leopard").

PerlWrapper is a Makefile that allows you to bundle your Perl applications together with the libraries needed inside a Mac OS X application bundle (.app). It has been tested using applications that use wxPerl.

Problems in distributing Perl applications
PerlWrapper was created to circument a few problems that Perl programmers encounter when trying to distribute applications for Mac OS X:

-	Mac users detest ungainly heaps of files that needed to be copied in order for an application to run. However, for your Perl application, you need the main perl file, your own libraries, other libraries, additional resources etc. 

-	If you depend on other libraries, you will have to either require the user to install them, or keep them in a subdirectory.

-	If you depend on external dynamic libraries or framework, the user will have to install them first before running your application.

- The user might have different versions of your required modules or libraries installed, causing your application to fail.

- Perl source files are not easily started by the user on Mac OS X, unless they are familiar with using a terminal.

-	All of these problems should be solved in a way that the application can still be distributed on other platforms (using e.g. PAR). PerlWrapper was created to make it easier to distribute applications using wxPerl, amongst others.

Bundling your own application with PerlWrapper
I suggest you open the Makefile first and take a look at the sample application to get a feel for what is going on. To create your own application bundle, follow these steps:

1.	Duplicate the PerlWrapper folder and name it accordingly.

2.	Copy your Perl source code inside the Perl-Source directory, including your libraries

3.	Make sure your main Perl file is called main.pl.

4.	Make sure your main Perl file returns a true value (if in doubt, add 1; as last line).

5.	Copy any third-party Perl libraries that your application depends on inside the Perl-Libraries directory. Make sure you include the XS files for those modules that use it.

	Note: Both Perl-Source and Perl-Libraries may contain libraries, the distinction is merely made to help you distinguish between your own libraries and those of others.

6.	Copy any dynamic libraries that your application depends on inside the Libraries directory (e.g. the wxWidgets libraries from /usr/local/lib).

Whew! Now you have included all the files that you need, excluding your resource files. What remains is to change the settings for your project and build it:

1.	Add any files that your application needs to the Perl-Resources directory.

2.	Double click on the target “PerlWrapper”. In “Build”, change the product name to your desired name. In “Properties”, change all settings according to your needs (executable name, identifier, icon file name, version, etc.).

3.	Edit the file InfoPlist.strings according to your needs. Remember to copy the file over into the other localization directories or change the localizations for this file.

This should be it. Press ⌘B to build your project and ⌘R to run it.

For future builds, Xcode sometimes will not notice when you updated any files that will reside inside the Resources directory (Perl source code, resource files etc.). To ensure a correctly built project, first press ⇧⌘K to clean the build files (or delete the Build directory), then build the project.

Environment supplied by PerlWrapper
Before your application is started, PerlWrapper does the following:

-	The current directory is set to your application bundle path. This is necessary for the dynamic libraries to be found.

-	$PerlWrapper::Version is set to the PerlWrapper version number (‘0.1’).

-	$PerlWrapper::BundlePath is set to the application bundle path.

- $PerlWrapper::ResourcesPath is set to the path of the Resources directory inside the bundle.

-	The bundle contains localization folders for all languages supported by Mac OS X, so that the application menu and file names in file dialogs will appear localized.

Alternatives to PerlWrapper
CamelBones lets you develop Perl applications using Xcode. As far as I know, it allows you to bundle the framework inside the application. See http://camelbones.sourceforge.net/ for more information.

Homepage
For more information and future releases, see the PerlWrapper homepage:
http://www.web42.com/software/perlwrapper/

License
Copyright © 2004 Christian Renz <crenz@web42.com>. All rights reserved.
Copyright © 2009 Mattia Barbon <mattia@barbon.org>. All rights reserved.

PerlWrapper is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Version history
0.1 (2004-06-12)
	- Initial release
0.2 (2004-10-23) 
	- Display errors if perl program fails
0.3
	- Build in 64 bit mode.
	- Build with Perl 5.10.

$Id: Readme.rtf 13 2004-10-23 10:47:29Z crenz $