在 KNOPPIX 平台安裝

KNOPPIX 是唯讀的光碟,因此必須將 Perl 安裝在硬碟中:

  1. fdisk /dev/hda 觀察有那一個 partition 可以用?若無,請用 fdisk 切一個。這裡假設 /dev/hda5 可以用:

    fdisk /dev/hda
    
    The number of cylinders for this disk is set to 2432.
    There is nothing wrong with that, but this is larger than 1024,
    and could in certain setups cause problems with:
    1) software that runs at boot time (e.g., old versions of LILO)
    2) booting and partitioning software from other OSs
       (e.g., DOS FDISK, OS/2 FDISK)
    
    Command (m for help): p
    
    Disk /dev/hda: 20.0 GB, 20003880960 bytes
    255 heads, 63 sectors/track, 2432 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1   *         1       914   7341673+   c  Win95 FAT32 (LBA)
    /dev/hda2           915      2432  12193335    5  Extended
    /dev/hda5           915      1615   5630751   83  Linux
    /dev/hda6          1616      1646    248976   82  Linux swap
    /dev/hda7          1647      2432   6313513+  83  Linux
    
    Command (m for help): q

  2. 把 /dev/hda5 mount 上來:(您的 HD 可能會不同,請勿直接套用!)

    mount /mnt/hda5

  3. 下載 perl 5.8.0

    mkdir /mnt/hda5/work
    mkdir /mnt/hda5/opt
    mkdir /mnt/hda5/opt/bin
    
    cd /mnt/hda5/work
    ncftp ftp2.tnc.edu.tw
    cd pub/unix/perl/CPAN/src
    get perl-5.8.0.tar.gz
    
    tar xvzf perl-5.8.0.tar.gz
    cd perl-5.8.0

  4. 因為 Perl 的預設安裝路徑(prefix) 為 /usr/local,但在 KNOPPIX 下它是唯讀的,無法寫入,因此我們要將安裝路徑指定到硬碟中的 /mnt/hda5/opt,方法如下:

    
./Configure -D prefix=/mnt/hda5/opt
    
    然後任何問題都按 Enter 回答即可。
    
    接著執行:
    
    make
    make test
    make install 
    
    即可
    
    若一切順利,會在 /mnt/hda5/opt/bin 中找到剛安裝的 perl

往後,若您想要使用這個版本的 perl,只要將您的程式第一列換成 #! /mnt/hda5/opt/bin/perl 即可。