http://www.perlmonks.org?node_id=1007903

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
I wrote a simple script to display a list of files in a directory:-

opendir(DIR, $dirname); @FILES= readdir(DIR); foreach $FILE (@FILES){ print $FILE."\n"; } closedir DIR;
The files in the directory are f1 f2 and g3. But I'm getting an output as:-
.
..
f1
f2
g3
What are the dots(. and ..) in the beginning,this is becoming a problem when I want to open files from a directory and perform manipulations on them as the . and .. files cannot be opened.