Results 1 to 5 of 5

Thread: How to run Perl file from the command line

  1. #1
    Join Date
    May 2009
    Location
    #bcstx
    Beans
    17

    How to run Perl file from the command line

    I'm trying to run a perl script found at http://wiki.scribus.net/index.php/Web_optimised_PDF.

    running "compress-newsletter.pl input.pdf" produces the result:

    -bash: compress-newsletter.pl: command not found

    Please help!

  2. #2
    Join Date
    Nov 2006
    Beans
    10

    Re: How to run Perl file from the command line

    You have to call it like this...

    perl compress-newsletter.pl input.pdf

  3. #3
    Join Date
    May 2009
    Location
    #bcstx
    Beans
    17

    Re: How to run Perl file from the command line

    If I run "perl compress-resume.pl input.pdf" then I get:

    Can't find compress-resume.pl on PATH, '.' not in PATH.

  4. #4
    Join Date
    Mar 2007
    Location
    Vancouver, BC
    Beans
    106
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to run Perl file from the command line

    Try adding this to the top of the file (must be first line)
    #!/usr/bin/env perl

    then make executable
    $ chmod +x compress-newsletter.pl

    now you should be able to execute the script directly using
    $ ./compress-newsletter.pl input.pdf

  5. #5
    Join Date
    May 2009
    Location
    #bcstx
    Beans
    17

    Re: How to run Perl file from the command line

    calling ./compress-resume.pl resume.pdf ran the script without changing the shebang line, but I have no idea why.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •