• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Perl HELP!

Well, err, that's an absolute filename, so it wouldn't really be in the current directory. I don't know perl really, but since it's a bastardized stew of shell syntax plus everything else, it should be this (which I got from man 1 test):

if(-f some_path) {
# it exists
}
 
Well first of all, I doubt you can open a directory (but I don't know perl, so who knows). Even if it were a file, a failed opening doesn't necessarily tell you anything about the file existing - which is what you asked for. A failed open() could result from a few things.
 
if (-d $dirname)
{
# directory exists
}

you could open directory (use opendir), but unless you're going to access it, it's no use.
plus, opendir() may fail even if it exists if you have no permission to access it
 
Back
Top