Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8453677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:49:23+00:00 2026-06-10T11:49:23+00:00

I had something weird happen on my computer. I had gperf installed under /usr/local/bin.

  • 0

I had something weird happen on my computer.
I had gperf installed under /usr/local/bin.
As related to questionI asked here I had a perl script running on my computer which contain the line system() on gperf with flags something look like

perl file:

system("gperf ...") == 0 || die "calling gperf failed: $?";

However no matter how hard I try the gperf will not run and out put the failed message

to debug I tried something like

system("echo \$PATH") == 0 || die "calling gperf failed: $?";

and found that it does not contain /usr/local/bin/ where i installed my gperf but only look in usr/bin where it was not installed

So the $PATH is wrong…
So I googled around and saw system() is same as calling /bin/sh inside a file so i tried /bin/sh and echo $PATH which found that it contain /usr/local/bin/ to my disbelieve.
So my question is where is the $PATH for a system() declared? why is it different then the one inside a Bourne shell ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:49:24+00:00Added an answer on June 10, 2026 at 11:49 am

    The PATH used by commands launched via system is the same as the one in the perl script, accessible through $ENV{PATH}. It’s the PATH that the perl script inherits from the program that called it, unless you changed it in the script.

    What’s biting you is probably that you set up your PATH in the wrong configuration file. Define it in ~/.profile, /etc/profile or other system-wide file, not in a shell configuration file such as .bashrc. See this question for some general information.

    If you want to set the path manually inside the perl script, you can use something like

    $ENV{PATH} = "/usr/local/bin:$ENV{PATH}" unless ":$ENV{PATH}:" =~ m~:/usr/local/bin:~;
    

    but this is probably a bad idea: in most cases, your script should not modify the path chosen by the user who runs that script.

    If you’re having trouble finding the right place to set PATH on your system after reading the question I linked to and the questions linked in my answer there, ask on Unix & Linux and be sure to state the details of your operating system (distribution, version, etc.) and how you log in (this is a user question, not a programming question).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today I had something weird happen in my copy of Resharper 5. I have
So something weird is happening for me here... i have had borders on my
Ok this is something weird. I got authlogic-oid installed in my rails app today.
Had something weird start happening to me today. I have an asp.net mvc app
I ran into something a bit weird with the hexl-mode under Emacs (GNU Emacs
Looking for a non-JS solution. Say I had something like this: <ul> <li> <form>
I have not had to do something like this in the past and am
Earlier this week, I had to do something which feels like a semantics violation.
In the past, when I've had to compile something on Snow Leopard (or any
I committed something and realize my comment had a spelling error, so I typed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.