http://qs321.pair.com?node_id=1059306


in reply to Should -f test return true for symlinks ? [RESOLVED]

I agree that the Perl document does not explicitly state the behavior in this case. But, you could test if it is both a file and a link:
$ perl -e 'printf "%d%d%d%d%d\n", -f "file", -f "link", -l "file", -l +"link", -f "link" and -l "link"' 11011

Caution: I haven't tested all the combos of files/dirs/links, etc.

Replies are listed 'Best First'.
Re^2: Should -f test return true for symlinks ?
by Bloodnok (Vicar) on Oct 23, 2013 at 14:13 UTC
    Indeed I could;-/

    I'll also raise a defect against the file test operator document to make plain the fact that the link is followed and suggest another use case when trying to determine a truly plain file.

    A user level that continues to overstate my experience :-))