@filesArray=(); &updateArray($path,\@filesArray); sub updateArray{ my $path = shift; my $myArray = shift; opendir(fp, $path); @dirList = readdir(fp); foreach $i(@dirList) { if (($i ne ".") && ($i ne "..")) { push @$fileArray, $path."/".$i; $spath = $path."/".$i; if( -d $spath ) { &GetDirArray($spath,\@filesArray); } } } closedir(fp); }