On Sep 26, a n said:

>I have a file that contains a list of file name prefixes and a directory
>of expanded file names as shown here.
>
>I need to read the prefix_list.txt and for each prefix, list Only the
>relevant files from the samples directory.
>
>For example: For the prefix : y022inv, the script should return the
>following list:
>
>y022invha0.txt y022invhb0.txt y022invhc0.txt.

  my @files;

  open PREFIX, "< prefix.names" or die "can't read prefix.names: $!";
  while (<PREFIX>) {
    chomp;
    push @files, <$_*>;
  }
  close PREFIX;

That should be all you need.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to