This should work... @filenames = ( @filenames, grep (!/^\.\.?$/ , readdir (DIR)) );
Rob -----Original Message----- From: Kipp, James [mailto:[EMAIL PROTECTED]] Sent: Friday, December 21, 2001 11:28 AM To: [EMAIL PROTECTED] Subject: getting multiple dir and file names into array Hello If I have an array of dir names and I want to capture the sub dir names and file names into an array, what is the best way to do this without overwriting the array each time thru? (see code below) Can I do a push or concatenate or something else ? Thanks --- @dirs = qw( /dbm1/user/ /dbm2/user/ ); # read in the files and directory names in the directory excluding . and .. foreach $dir (@dirs) { unless (opendir (DIR, $dir)) { print "\n Path not found - $dir\n\n"; exit 1; } @filenames = grep (!/^\.\.?$/ , readdir (DIR)); } closedir DIR; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]