[LA.pm] -l returns false on broken symlinks

Ask Bjørn Hansen ask at develooper.com
Wed Feb 16 16:56:26 PST 2005


On Feb 16, 2005, at 4:40 PM, Ofer Nave wrote:

> I've just discovered that the -l test operator returns false on broken
> symlinks.  This, of course, makes perfect sense, since in the context 
> of
> symlinks it is known that the operator's tests apply to the symlinks
> target, and with regards to a broken symlink, the target clearly 
> doesn't
> exist.  :)

Hi Ofer,

It returns true for me on all the platforms I could easily test on...

$ ln -s /asdfasf/sdfasdf test
$ perl -e 'print "yes\n" if -l "test"'
yes

How are you testing it?


  - ask

-- 
http://www.askbjoernhansen.com/



More information about the Losangeles-pm mailing list