Connecting Tech Pros Worldwide Forums | Help | Site Map

can't run program from directory it's in

Newbie
 
Join Date: Oct 2007
Posts: 1
#1: Oct 18 '07
i can't run my program test.pl without preceding it with the absolute directory even when I am in the directory which holds my program ie:
this works
/users/mydirectory/test.pl
this doesn't
test.pl
even tho I am in the /users/mydirectory and the program is there as confirmed by the "ls" command
what I get is a message
-bash: test.pl: command not found
when I try to run the program from the directory it is in

numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,572
#2: Oct 18 '07

re: can't run program from directory it's in


That is because the present directory (.) is not in your $PATH variable. You will have to edit your .bashrc file and add it to your PATH.

Also, this is not a Perl issue. If you have questions about how to do this, then I can move this over to the Unix/Linux/BSD forum for a more precise answer to your question.

Regards,

Jeff
Reply