Date: Thu, 27 Sep 2001 10:25:30 -0400 From: "LEPP" Subject: Beginner Question Message-Id: <9ovcg1$bdf$1@bob.news.rcn.net> I am writing my first perl script and want to know if my strategy is sound. I want to write a script that will list all of the directories in the current working directory and save the list into an array. It will then list all of the files in each of those subdirectories. I have gotten this far. The part that is difficult is that when I output all of the files to std out, I need to have two columns. One column should be all of the files in alphabetical order and one column listing the directory that it is in. Attached is the current code. I have all of the directories and subdirectories in the array but the problem is that I feel that I really need to use a C style struct but I can't find if that is available in Perl. The problem is that I cannot find a way of storeing what directory every file is in. Any help would be greatly appreciated. Thanks LEPP #! /usr/bin/perl @dirs =( `ls -F | grep /` ); $index=0; #@dirs=`ls -F | grep /`; print @dirs; print $dirs[1]; print $dirs[2]; print "$#dirs is the length of the array \n"; while ($index <= $#dirs) { print "$index \n"; print `ls $dirs[$index]`; push @dirs , `ls $dirs[$index]`; # print "/$dirs[$index]" $index++; } print "Here is the sorted list \n"; print reverse sort @dirs; #push @dirs, `ls -F | grep /`; print "after push \n @dirs";