use Cwd; my $dir=Cwd->getcwd(); opendir(DIR,"$dir")or die "@!";