Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Re:How to go to /usr/bin/perl

Discussion in 'General Discussion' started by phpserver, Nov 5, 2008.

  1. phpserver

    phpserver Registered

    Joined:
    Nov 2, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Eastleigh,Nairobi
    I want to find my way to /usr/bin/perl.How do i do it?
     
  2. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    66
    Hello,

    That is path to perl in which perl is installed. You do not need to access it.

    When writing any perl script, it should start with

    #!/usr/bin/perl

    and the perl script needs to be under the cg-bin folder of your domain
     
  3. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    Just a small elaboration:

    You can use perl via CLI (command line interface) using the flag, "-e".
    ie. perl -e 'print "hello world! i am ".`whoami`."\n";'

    If you want to use it in a web-accessible script (CGI), you'll need to rename the script's extension to .cgi and add the first line - #!/usr/bin/perl - If your *CGI script is printing to `stdout`(cheap pun) - be sure that you're printing "content-type: text/html\n\n"; before anything else.

    Renaming the extension to .cgi triggers the Apache handler/mime type and Apache then knows to treat the script as Perl/CGI - the same concept goes for .php, .txt, .html, .shtml, ect.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice