Question: for example i have :  

file directory: C:\Users\Desktop\program  

files in directory: cheese(folder) ,veggie(txt file), meat(doc file)  

How do i record down the names of the files and folder in the directory?
Thanks in advance!!

Answer: 
Another way is to use [glob](http://perldoc.perl.org/functions/glob.html):

```
my @files = <*>;

```

This will give you all of the files in the current directory. 

This method is convenient if you only want to find certain files:

```
my @jpegs = <*.jpg>;

```

If that isn't the directory you want, [change to the current directory](http://perldoc.perl.org/functions/chdir.html) or include the path:

```
my @files = </foo/bar*>;

```

Note that you should [use forward slashes](http://perldoc.perl.org/File/Glob.html#NOTES) even if doing this on Windows.
Try the following:

```
opendir FOLDER, $folder or die "Cant open folder $folder: $!";
my @file= readdir FOLDER;
closedir FOLDER;

```