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 8544899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:40:19+00:00 2026-06-11T12:40:19+00:00

I have a perl script exist in the follwoing path (/home/Leen/Desktop/Tools/bin/tool.pl) Every time I

  • 0

I have a perl script exist in the follwoing path (/home/Leen/Desktop/Tools/bin/tool.pl)
Every time I want to run this tool I go to the terminal

>

and then change the directory to

…./bin>

Then I run the perl by writing

..../bin> perl tool.pl file= whatever config= whatever

The problem is that I want to run this perl script without the need to go to the bin folder where it exist . so I can run perl script from any directory and as soon as I enter shell
I went to the etc/environment and I wrote the follwoing

export PERL5LIB=$PERL5LIB:/home/Leen/Desktop/Tools/bin

But when I go to terminal and write the follwoing straight ahead without going to bin folder where tool.pl exist

>perl tool.pl file=... config=...

it says the file “tool.pl” does not exist???

  • 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-11T12:40:20+00:00Added an answer on June 11, 2026 at 12:40 pm

    The first argument to the perl program is the path to an executable file. These calls are equivalent:

    :~$ perl /home/Leen/Desktop/Tools/bin/tool.pl
    :~$ perl ~/Desktop/Tools/bin/tool.pl
    :~$ perl ./Desktop/Tools/bin/tool.pl
    :~/Desktop/Tools/bin$ perl tool.pl
    :~/Desktop/Tools/bin$ perl ./tool.pl
    

    etc.

    In the shell the tilde ~ expands to your home directory, and ./ symbolizes the current directory. On *nix shells (including the various terminal emulators on ubuntu), the command prompt ususally is $ in nomal mode, # as root user and seldom %. > Is a secondary command prompt, e.g. when continuing a multiline argument, unlike cmd.exe on Windows.

    The PERL5LIB variable determines where Perl looks for modules, not for executable files.

    You can set a script as executable via chmod +x FILENAME. You can then call the script without specifying the perl program:

    :~/Desktop/Tools/bin$ ./tool.pl
    

    You can modify the PATH variable to change where the shell looks for executables. The PATH usually contains /usr/bin/ and other directories. You can add a directory of your own via

    PATH=$PATH:/home/Leen/Desktop/Tools/bin
    

    Add your directory at the end of the PATHes, so you don’t overrule other programs.

    If you want to set this permanently, you can add this line to the file ~/.bashrc (only for your user and only for the bash shell).

    Then you can call your script from anywhere, without a full path name:

    :~/foo/bar$ tool.pl
    

    You should consider using a more specific command name in this case, to prevent name clashes.

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

Sidebar

Related Questions

I have a Perl script called replaceUp: #!/usr/bin/perl search=$1 replace=$2 find . -type f
I have this Perl script sitting in the cgi-bin folder of my Apache server:
I have a Perl script that does a fork/exec to start another tool in
I have a Perl script that has two dependencies that exist in CPAN. What
I have the following code in in a Perl script I'm writing: #!/usr/bin/perl use
I have a Perl script that outputs text. I want to import this text
I have a Perl script that takes user input and creates another script that
I have a perl script URL which gives me a ZIP file, it processes
I have a Perl script which maps two drives, and then proceeds to copy
I have a Perl script that uses WWW::Mechanize to read from a file and

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.