perl - file type
Hi
$type = ( -d "$path\\$entry" ) ? "dir" : "file";
Says:
If the entity: $path\\$entry is a directoy, then assign $type as "dir" otherwise then it seems that it is a file then assign $type as "file".
You may also change as this also:
if (-d "$path\\$entry"){
$type = "dir";
}
elsif (-e "$path\\$entry"){
$type = "file";
}
else{
$type ="undefined!";
}
Note:
The code seems to be used in win32, but you can use from single slash instead of double backslashses too.
"$path\\$entry"
"$path/$entry"
tnx