Using readdir to get the content in a folder
opendir(DIRECTORY, '.') or die "Can't open current directory."; print join (', ', readdir(DIRECTORY)); closedir DIRECTORY;