Thanks to visit codestin.com Credit goes to perldoc.perl.org
Sets the current position to the beginning of the directory for the readdir routine on DIRHANDLE.
readdir
Portability issues: "rewinddir" in perlport.