Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!world!ksr!dgg From: dgg@ksr.com (David Grubbs) Newsgroups: comp.lang.perl Subject: Bug in File test operator? Message-ID: Date: 5 Dec 90 05:13:34 GMT Sender: news@ksr.com Organization: Kendall Square Research, Waltham, MA Lines: 32 To test if a pathname is really a directory, I got used to: if (! -l "pathname" && -d _) { code; } where I originally (when I first started using PERL) thought I wanted: if (-d "pathname") { code; } [The file test operators use "stat()", except for '-l' which uses "lstat()".] It no longer works as I expect. The following short test demonstrates it. if (-l "." || ! -d _) { # "." is always a real directory. print "Broken.\n"; } else { print "OK.\n"; } Stuff the above into a file (/tmp/perl_test) and feed it to perl3.patch18 < /tmp/perl_test Output: OK. perl3.patch41 < /tmp/perl_test Output: Broken. Has anyone else seen this? -- David G. Grubbs Kendall Square Research Corp. {harvard,uunet,world}!ksr!dgg dgg@ksr.com Brought to you by Super Global Mega Corp .com