my @dirs=''; my $dir='/usr/local/apache/cgi-bin/users'; my $choice=''; title(); #get user directories #get all the files in the directory opendir DIR, "$dir"; my @directory=grep(!/^\.\.?$/, readdir DIR); # remove . and .. entries closedir DIR; # get only directories not files foreach (@directory){ my path=$dir.'/'.$_; if (-d $path){ push @dirs,$_; } } # here i prove to myself that the array does contain values foreach (@dirs){ print "$_\n"; } #program flow while($choice ne 'x'){ if ($choice ne 'x'){ menu(); print "\nPlease enter an option =>"; $choice=chomp(); } if ($chioce eq '1'){ # parse user details file $no_users=0; foreach (@dirs){ my $path=$dir.'/'.$_; my $filename=$path.'/'.$_.'_details'; print "$_\n"; # this prints nothing!!!! # rest of scripr........etc