1 2 3 4 5 6 7 8 9 #### #/bin/perl/ use strict; use warnings; use autodie; my $molec = "1ac6"; my $cluster; my $times; my $input; my @list; my $list; my $line; my $path = "/media/RAIDstorage/home/athina/dist-analysis/${molec}/timeseries/test"; my @files; @files = `ls $path\/$molec-times*`; foreach (@files) { /${molec}-times-(\d+)-clust(\d{1})/; $times = $1; $cluster = $2; open $input, '<', "$path\/${molec}-times-${times}-clust${cluster}.out" or die $!; while ($line = <$input>) { chomp $line; #next unless $. > 4; push @list, [split/\s+/, $line]; }#while close $input; print "$list[0][1] \n"; }#foreach