data67 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to access two directories and open files that match a particular pattern; then I was trying to read in the data from those files in to an array. Where am I going wrong.
How can i read files in a directory(test1) and its sub-directory(test2) and put them in an array.
The following is a portion of the code. THANKS
opendir(DIR,"/users/temp/test1"); while(defined (my $line = readdir(DIR))){ next if ($line =~ /^\./); . . chomp $line; @filedata = split /!/, $line; . . } closedir (DIR);
Edited: (footpad) 15 Sep. 2001, 20:02 PDT; 16 Sep. 2001, 03:02 GMT
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: reading directories
by dga (Hermit) on Sep 14, 2001 at 21:10 UTC | |
Re: reading directories
by higle (Chaplain) on Sep 14, 2001 at 21:17 UTC | |
by merlyn (Sage) on Sep 15, 2001 at 05:45 UTC | |
Re: reading directories
by suaveant (Parson) on Sep 14, 2001 at 21:32 UTC | |
Re: reading directories
by HamNRye (Monk) on Sep 15, 2001 at 01:33 UTC | |
by Anonymous Monk on Sep 15, 2001 at 21:10 UTC | |
by HamNRye (Monk) on Sep 19, 2001 at 02:18 UTC |
Back to
Seekers of Perl Wisdom