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

Ofer Nave ofer at netapt.com
Wed Feb 16 16:40:47 PST 2005


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.  :)

However, this brings up the question: If you want to determine whether or 
not the symlink exists, how do you?  Prerably without ugliness like system 
calls and parsing text output.

-ofer



More information about the Losangeles-pm mailing list