(2) Questions regarding the [Hash] and [Reading a directory]

I have two questions.

1) I'm trying to let the user type his "directory path" (perl example.pl /Users/name/file) in order to show the files or directory folder, i also wanted to show if the file or directory can or cannot be read, written, and executed

This the code i came up with.. but i still wanted to know if i can find the way of indicating if the file or directory and if it can or cannot be
read, written, and executed. I also wanted to make sure about what i making is good on other systems ( Linux/Unix/Mac)

2) Question 2, i want to print out elements of hash and i want to use different ways of listing them.. just as each funiction, keys function,
values function and finaly sort keys.. and what i did was the following code and i don't know where is my problem...