#!/usr/bin/perl -w use strict; opendir DIR, "." or die "Could not opendir: $!"; foreach my $name (readdir(DIR)) { print "There is a files $name in this directory\n"; } closedir DIR;