Find the answer to your Linux question:
Results 1 to 10 of 10
Hi all, This is gonna sound like a stupid question, but where is perl kept on SUSE 9.1? It is NOT in /usr/bin/perl and I need to change my perl ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Posts
    8

    Where is perl in SUSE 9.1


    Hi all,

    This is gonna sound like a stupid question, but where is perl kept on SUSE
    9.1?

    It is NOT in /usr/bin/perl and I need to change my perl scripts to find it
    in the right directory.

    Is there a simple command I can run to find out?

    Or does one of you know it?

    Thanks in advance,

    Robin

  2. #2
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    if you know the exact name of the file you need, the
    Code:
    find
    command will show you its location, if you need to search, just use
    Code:
    grep
    and see if that turns up anything.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  3. #3
    Just Joined!
    Join Date
    Jul 2004
    Posts
    8
    Hi

    I don't think its a particular file I need, I just need the path to perl to put at the top of my perl scrips.

    Any ideas?

    Robin

  4. #4
    Linux Newbie
    Join Date
    May 2004
    Location
    Boston, MA
    Posts
    246
    Yeah... perl is a file...

    It's almost always /usr/bin/perl, but if "perl" works as a command at the terminal, then "which perl" should tell you where it is. Otherwise, a "locate *bin*perl" will show it up for you.

    Hope this helps.
    Situations arise because of the weather,
    And no kinds of love are better than others.

  5. #5
    Just Joined!
    Join Date
    Jul 2004
    Posts
    8
    Thanks...I've found perl now but the script still isn't working.

    The script is a test script I got off the net to check my apache and perl installations.

    Here it is:

    #!/usr/bin/perl

    print "Content-type: text/html\n\n";
    print <<"EOF";
    <html><head></head><body>
    Thats all folks...
    Done</body></html>
    EOF

    When I try to run this I get:

    Server error!
    The server encountered an internal error and was unable to complete your request.

    Error message:
    Premature end of script headers: test.pl

    Any ideas on what to do?

    I have read elsewhere on the net that I needed to check that /usr/bin/perl was my perl installation. I have done that now (and that is where it is) but it still won't work.

    Robin

  6. #6
    Linux Newbie
    Join Date
    May 2004
    Location
    Boston, MA
    Posts
    246
    Make sure the script doesn't have any DOS newlines, and find out what happens when you run it from the command line with
    Code:
    /usr/bin/perl -w test.pl

  7. #7
    Just Joined!
    Join Date
    Jul 2004
    Posts
    8
    Hi

    It works fine then...and now it works fine on the web. Wonder what changed!?

    My other script gives the error that this one gave tho:

    #!/usr/bin/perl

    #
    # Name: greetings.pl
    #
    # Purpose:
    #
    # Show a greeting message
    #
    ################################################## ########
    use strict;
    use CGI;
    #
    # Get user data
    #
    my $query = new CGI;
    my $name = $query->param(‘name’);
    #
    # Process data
    #
    $name = lc($name);
    my @strArray = ();
    foreach my $str (split(/ /,$name)) {
    push(@strArray, ucfirst($str));
    }
    my $formattedName = join(‘ ‘, @strArray);
    #
    # Display results
    #
    print $query->header;
    print $query->start_html(‘Greetings’);
    print $query->p( ‘Hello ‘ . $formattedName . ‘,’);
    print $query->p( ‘Thanks for coming to our Web site.’);
    print $query->end_html;
    #
    # Terminate
    #
    exit 0;

    Dunno y

    thanks a lot

    Robin

  8. #8
    Linux Newbie
    Join Date
    May 2004
    Location
    Boston, MA
    Posts
    246
    Crazy -- that wasn't supposed to change anything!

    Anyway, what happens when you run that one with the -w flag from the command line?

  9. #9
    Just Joined!
    Join Date
    Jul 2004
    Posts
    8
    Hi

    I get lots of syntax errors....would that give it the error I'm getting online?

    Have you got a simple perl script I can try (preferably with one of the ?name=robin type bits - I dunno what they're called)?????

    Robin

  10. #10
    Just Joined!
    Join Date
    Aug 2004
    Posts
    4

    "which perl"

    I'm not sure what version of 9.1 you're using, if it's the personal ed. it could be that perl is not included.
    If you installed 9.1 as default it's located in /usr/bin/perl ("which perl" delivers this), or you have not yet installed perl.

Posting Permissions

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