01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

export TEMP=/c/temp<br />

Now you can start CPAN in Cygwin, as in Linux, with<br />

cpan<br />

When you first open CPAN, it must be configured. That means you<br />

will need to answer a host of questions that can all be confirmed<br />

with , until you are asked to indicate your area of <strong>the</strong><br />

world. Enter <strong>the</strong> number of your continent, e.g. for “North America,”<br />

and in <strong>the</strong> next question, your country, e.g. “USA.” Now you<br />

will see a list of servers that you can select by entering one or more<br />

numbers separated by a space. Now you should see <strong>the</strong> cpan><br />

prompt.<br />

The program is ready, and you can set up <strong>the</strong> missing modules using<br />

<strong>the</strong> install command. TWiki, for example, requires <strong>the</strong> following<br />

three packages:<br />

install Net::SMTP<br />

install Digest::SHA1<br />

install MIME::Base64<br />

Perl is <strong>the</strong>n equipped for all eventualities of TWiki operation. You<br />

can leave CPAN with <strong>the</strong> command exit.<br />

Shebang<br />

The Perl script files must be adapted so that <strong>the</strong>y refer to <strong>the</strong> Perl interpreter.<br />

This allows <strong>the</strong> web server to “know” what to do with <strong>the</strong><br />

file. Under UNIX, it is possible to indicate <strong>the</strong> type of file or program<br />

with which <strong>the</strong> script is to be executed at <strong>the</strong> beginning of a<br />

document, in <strong>the</strong> so-called shebang line. In our case, it must refer to<br />

<strong>the</strong> Perl interpreter. The TWiki scripts are set up by default such that<br />

<strong>the</strong>y refer to <strong>the</strong> standard Perl path under Linux. Thus, under Windows,<br />

you will most likely have to adjust this. You can use <strong>the</strong><br />

Cygwin shell to do so. The method shown is also valid for Linux.<br />

First, switch to <strong>the</strong> bin directory and create a backup for <strong>the</strong> event<br />

that something does not function properly:<br />

cd /twiki/bin<br />

mkdir .backup<br />

cp * .backup<br />

Shebang �<br />

�<br />

�<br />

367

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!