Perl problems

Colin Watson cjwatson at ubuntu.com
Thu May 12 09:29:02 UTC 2005


On Wed, May 11, 2005 at 10:42:57PM -0400, Joe Wamsley wrote:
> Sorry that I forgot to mention that, but yes my file is executable when
> I run ls -la secede2.pl I get this -rwxr--r--  1 netrattler netrattler
> 50 2005-05-11 22:07 secede2.pl. I also tried this that someone else
> suggested by running ./secede.pl names.txt and it works so is there any
> chance that maybe I have the incorrect PATH.

No, you have the *correct* PATH. :-) The current directory is
intentionally not on PATH; this avoids subtle security issues where, for
example, you've changed into another user's home directory to look at
one of their files, they have an 'ls' executable in their home directory
that runs 'rm -rf $HOME', and bye-bye. DOS gets this wrong.

(It's less bad if '.' is at the end of PATH, but people can still fish
for common typos, e.g. 'sl'.)

My advice would be:

  * get used to running ./foo when you want to run something from the
    current directory, as really, this is a feature for your own
    protection;

  * create a ~/bin directory for your own programs that you run
    regularly, and put that on PATH; there's a bit in the default bash
    configuration that does that.

Cheers,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list