in reply to size and exist doesnot work with UNC folders/dir

G'day mukes,

Welcome to the monastery.

In order to provide you with some help on this, it would be useful if you posted the actual output (rather than just stating what isn't printed).

For instance, "this does not print the file size", could mean that the statement "print "file size for $file is $fileSize\n";" is never executed, or that it prints something like one of these:

file size for some_filename is file size for some_filename is 0 file size for some_filename is not_a_file_size_value file size for some filename with spaces is

Note that last example. If any of your files, directories, or other path components, contain spaces, you'll probably need to quote them.

I see one other print statement. You could add more, right after each variable assignment: this is often a good way to locate problems.

While it doesn't appear to be an issue in this particular code, be aware that readdir returns just the filename, not a full path. You often need to prepend the path.

You haven't shown all of your code. While I can guess there's a "use Cwd;" line somewhere, I don't actually know. I also don't know what else may (or may not) be present that could affect how your code runs.

There's guidelines for all of these things, and more, in "How do I post a question effectively?".

You might also be interested in the results of a search for 'UNC' on CPAN.

-- Ken