try this open (OUT, "ls -1 $target_dir/bin/$foo.*.dat|") || die "can not list the dir/file $!"; my @files = <OUT>;
this will include $target_dir/bin/ and end line character, need process if necessary hope this is what you want. zlm ----- Original Message ----- From: "Don Mathews" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 3:04 PM Subject: List files > Hello: > > I need to list all the files matching a pattern in a directory.Can anyone provide an example to do that. > > eg. > I would do $target_dir/bin/ls $foo.*.dat in UNIX. > > I want to do the same thing in perl and just store the names of all the $foo.*.dat files in a temporary array which I can manipulate. > > Rgds. > > > > > > _____________________________________________________________ > Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. > http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus > >