#!/usr/bin/perl # go to directory with subject-specific sub-directories cd .. #or die "directory not changed!\n"; opendir(DIR,"."); @files = ("SubjectASD202","SubjectASD203"); print "@files"; #say something stupid and unnecessary print "\n Thanks, I'll do the rest for you, just wait a second. \n"; $s = 0; foreach (@files) { # do second level statistical analysis run by run # go to the directory where the fsf-file for stats and post-stats is stored chdir "/mnt/hgfs/ExpAutism/Scripts"; # create a copy of the fsf file #original file is needed as basis for all subjects: Level1Run1.fsf - specific file is being overwritten for each run:Level1Run1_spec.fsf use File::Copy; #create string that will be used for foe-wildcard replacement copy ("Level1Run1.fsf","Level1Run1_spec.fsf") or die "Copy failed"; use Tie::File; tie @array, 'Tie::File', "Level1Run1_spec.fsf" or die "arraying failed"; # replace dummies for user and subject with specific values for (@array) { #replace wildcards with specific titles of subjects s/Subjectx/$files[$s]/g; } untie @array; print "working on the stats concerning $files[$s]\n"; `/usr/local/fsl/bin/feat Level1Run1_spec.fsf`; $s=$s+1; } print "\n +++ DONE +++ \n"; #### SubjectASD202 SubjectASD203 Thanks, I'll do the rest for you, just wait a second. working on the stats concerning SubjectASD202