hpssMakeList.pl 444 B

123456789101112131415161718192021222324
  1. use strict;
  2. use warnings;
  3. my $inFile = $ARGV[0];
  4. open(my $fhIn, "<", $inFile)
  5. or die "Could not open $inFile $!";
  6. my $outFile = $ARGV[1];
  7. open(my $fhOut, ">", $outFile)
  8. or die "Could not create $outFile $!";
  9. my $outDir = $ARGV[2];
  10. while (my $line = <$fhIn>)
  11. {
  12. chomp($line);
  13. my @fields = split('/', $line);
  14. my $fileName = $fields[@fields - 1];
  15. print $fhOut "$line $outDir/$fileName\n";
  16. }
  17. close $fhIn;
  18. close $fhOut;