Help for this page
next if -f $subdir;
next unless -d $subdir;
foreach my $subdir ( sort @subdirs ) { chdir($dir); next unless -d $subdir; ...
use strict; use warnings; ... chdir $dir . '/' . $subdir; system("echo '1 0' | program -f methane.trr -o $result_path/$subdi +r/outfile.txt"); }