#!/usr/bin/perl use File::chdir; use Cwd; use strict; my $dir='/data1/sgb'; chdir '$dir/Hsapiens_fasta_folder'; my @files=<*.fa>; chdir '$dir/targetp-1.1'; my $current=getcwd(); foreach my $file( @files) { print "$file\n"; print "$current\n"; }