#!/usr/bin/perl use warnings; use strict; # give directory with ELAND files as argument opendir(DIR, $ARGV[0]) or die "can't opendir $ARGV[0] $!"; my @Files = readdir(DIR); my $path = "\/Users\/cgrunau\/Desktop\/24mar2011\-30\-2\,7\,7\/subfiles\/"; #get rid of '.' and '..' shift @Files; shift @Files; foreach (@Files) { system ("perl \/Users\/cgrunau\/Desktop\/TR2txt\.pl -f $path$_ -o \/Users\/cgrunau\/Desktop\/output\.txt"); }