Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: "The stat preceding -l _ wasn't an lstat"?

by Tanktalus (Canon)
on Jan 15, 2010 at 23:51 UTC ( [id://817716]=note: print w/replies, xml ) Need Help??


in reply to "The stat preceding -l _ wasn't an lstat"?

Maybe it depends on whether the last stat was successful or not? That is, if sysinfo.pl doesn't exist, your code gives me no problems, printing FooBar. But, on the same machine, if I then touch sysinfo.pl, I get the error message you complain about. Perhaps perl can't tell the difference between an unsuccessful stat and an unsuccessful lstat, when using "-l _" because it's just not stored?

  • Comment on Re: "The stat preceding -l _ wasn't an lstat"?

Replies are listed 'Best First'.
Re^2: "The stat preceding -l _ wasn't an lstat"?
by Burak (Chaplain) on Jan 17, 2010 at 21:32 UTC
    You're right I guess. Btw, I'm doing -f $file && ! -l $file (double call) now to prevent this error.

      Just reverse it, and it's ok. ! -l $file && -f _. The -f flag can work on lstat's output, whether the lstat found a link or not.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://817716]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found