Using Perl

Discussion in 'macOS' started by ChrisFromCanada, Nov 17, 2005.

  1. ChrisFromCanada macrumors 65816

    ChrisFromCanada

    Joined:
    May 3, 2004
    Location:
    Hamilton, Ontario (CANADA)
    #1
    I just have a perl application I want to try out and am having trouble. I have the .pl file on the desktop and I type the following in terminal:

    cd desktop

    chmod 755 NAME OF APPLICATION.pl

    perl NAME OF APPLICATION.pl

    and I get the following error:

    Can't locate XML/DOM.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 .) at nzbperl.pl line 30.
    BEGIN failed--compilation aborted at nzbperl.pl line 30.


    Any Ideas?
     
  2. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #2
    You're requiring a module that you don't have installed, most likely by the statement:

    Code:
    use XML::DOM;
    
    You should be able to install this by using CPAN:
    Code:
    perl -mCPAN -e shell
    
    then issuing:
    Code:
    install XML::DOM
    
     
  3. ChrisFromCanada thread starter macrumors 65816

    ChrisFromCanada

    Joined:
    May 3, 2004
    Location:
    Hamilton, Ontario (CANADA)
    #3
    Thanks. I tried it and get:

    usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
    [-o owner] file1 file2
    install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
    [-o owner] file1 ... fileN directory
    install -d [-v] [-g group] [-m mode] [-o owner] directory ...




    and I retried running it as in my first post but i get the same error...
     
  4. superbovine macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #4
    Code:
    cow@supercow cow $sudo perl -MCPAN -e shell
    Password:
    
    cpan shell -- CPAN exploration and modules installation (v1.7601)
    ReadLine support enabled
    
    cpan> install XML::DOM
    CPAN: Storable loaded ok
    Going to read /Users/cow/.cpan/Metadata
      Database was generated on Thu, 10 Nov 2005 04:14:08 GMT
    LWP not available
    CPAN: Net::FTP loaded ok
    Fetching with Net::FTP:
      ftp://carroll.cac.psu.edu/pub/CPAN/authors/01mailrc.txt.gz
    Going to read /Users/cow/.cpan/sources/authors/01mailrc.txt.gz
    CPAN: Compress::Zlib loaded ok
    LWP not available
    Fetching with Net::FTP:
      ftp://carroll.cac.psu.edu/pub/CPAN/modules/02packages.details.txt.gz
    Going to read /Users/cow/.cpan/sources/modules/02packages.details.txt.gz
      Database was generated on Thu, 17 Nov 2005 23:56:51 GMT
      HTTP::Date not available
    LWP not available
    Fetching with Net::FTP:
      ftp://carroll.cac.psu.edu/pub/CPAN/modules/03modlist.data.gz
    Going to read /Users/cow/.cpan/sources/modules/03modlist.data.gz
    Going to write /Users/cow/.cpan/Metadata
    Running install for module XML::DOM
    Running make for T/TJ/TJMATHER/XML-DOM-1.44.tar.gz
    LWP not available
    Fetching with Net::FTP:
      ftp://carroll.cac.psu.edu/pub/CPAN/authors/id/T/TJ/TJMATHER/XML-DOM-1.44.tar.gz
    CPAN: Digest::MD5 loaded ok
    LWP not available
    Fetching with Net::FTP:
      ftp://carroll.cac.psu.edu/pub/CPAN/authors/id/T/TJ/TJMATHER/CHECKSUMS
    Checksum for /Users/cow/.cpan/sources/authors/id/T/TJ/TJMATHER/XML-DOM-1.44.tar.gz ok
    Scanning cache /Users/cow/.cpan/build for sizes
    XML-DOM-1.44/
    XML-DOM-1.44/lib/
    XML-DOM-1.44/lib/XML/
    XML-DOM-1.44/lib/XML/DOM/
    XML-DOM-1.44/lib/XML/DOM/DocumentType.pod
    XML-DOM-1.44/lib/XML/DOM/DocumentFragment.pod
    .
    .
    .
    you get the idea
    
     
  5. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #5
    Oops, I always get the -M option in the wrong case.
     

Share This Page