#!/usr/bin/perl -w use strict; my @files; opendir(DIR,"/some_dir"); while(){ next if (/^.$/); @files = readdir(DIR,$_); }