#!/usr/bin/perl -w use strict; use Cwd 'abs_path'; use Cwd; use File::Basename; if (defined ($ARGV[0])){ #scripts directory my $d= getcwd();; #results directory my $res= abs_path($ARGV[0]); # loop through the cases in data opendir( DIR, $res ) || die "Error in opening dir $res\n"; my @files = readdir(DIR); close(DIR); foreach my $sample (@files){ print $sample . "\n"; } } else {print "Need to supply argument\n"};