Installation and setup
Let's take a look at how to install the EPIC plug-in so you can use the IDE features to write Perl applications.
Before looking at EPIC, you need to install the plug-in. Before you get there, you will obviously need a Perl interpreter. I'm using Mac OS X, which, being based on BSD, comes with the UNIX-based Perl interpreter that you might otherwise have access to on any other UNIX/Linux host. On Windows, you can use the ActivePerl interpreter (from ActiveState) or the Perl interpreter provided as part of the Cygwin system. I prefer ActivePerl, but the choice is yours.
Once you have a Perl interpreter handy, use the Software Update component of Eclipse to install it:
- Choose Help > Software Update > Find and Install, and you'll be presented with a window for configuring downloads, as shown in Figure 1.
Figure 1. The Software Update window
- Click Next.
- Click New Remote Site. Give the new site a name and enter the source URL (
http://e-p-I-c.sf.net/updates"), as shown in Figure 2.
Figure 2. Creating a new site
- Then follow the on-screen process to find, select, and install the plug-in.
You'll take a closer look at the preferences and their effect on how you use and work with the EPIC plug-in later, but you can benefit from a brief look at the preferences panel to get an idea of the sort of facilities that are available when using the plug-in.
To access the preferences for EPIC, open the standard Eclipse Preferences Window and choose the Perl EPIC folder from the navigation panel on the left, as shown here in Figure 3.
Figure 3. EPIC Preferences
The preferences are split into sections, starting with the general preferences for the plug-in:
- General Preferences -- Sets the location of the Perl executable, interpreter, execution model, and the period to wait before the code is checked in the background.
- Code Assist -- Sets the characters that trigger auto-completion.
- Editor -- Sets editor preferences, including the colors used for highlighting different components, annotation formats, and so on.
- Source Formatter -- Sets formatting preferences.
- Task Tags -- Sets task tags, which are quick notes that take you back to a specific location.
- Templates -- Sets up templates of code that can be inserted directly into your code to speed development time.
When these options affect the way you work, I'll mention how to adjust the action in this tutorial. We'll also look at some specific elements, such as task tags and templates, in their own sections later.
When using the EPIC plug-in within Eclipse under Windows, there are some tricks that will improve your interaction between components.
If you are using ActiveState's ActivePerl distribution, change the Perl executable (as set in the General Preference panel) to the wperl.exe executable. This will prevent a command prompt window being displayed each time the code is being checked. It is also a good idea (but not essential) to add the Perl binary directory to your path. It should have been added automatically when ActivePerl was installed.
If you are using the Cygwin version of Perl, ensure that the mount command, part of the standard Cygwin installation, is available through your system path. You can verify this by checking the values of environment variables. To do this:
- Open the System Control Panel (usually in Start > Control Panels > System, or right-click on My Computer and select Properties).
- Switch to the Advanced panel.
- Click Environment Variables. You should be presented with a window like that shown in Figure 4.
Figure 4. System and user environment variables in Windows
Check the value of the PATH variable. If the Perl or Cygwin binary directories are not listed, add them to the path value. Individual directories are separated by a semicolon.