my $dir = "../data/ifx/reports/"; opendir (DIR, $dir) or die "cannot opendir $dir"; foreach my $file (readdir(DIR)) { if(($file eq ".") || ($file eq "..")) {} else { print $file."
"; &Read_Next_Dir ($file); } } closedir (DIR); sub Read_Next_Dir { my $param = $_[0]; my $dir = "../data/ifx/reports/".$param."/"; opendir (DIR, $dir) or die "cannot opendir $dir"; foreach my $file (readdir(DIR)) { if(($file eq ".") || ($file eq "..")) {} else { print "---->";print $file."
"; &Read_Report_Dir ($file, $param); } } closedir (DIR); } sub Read_Report_Dir { my @report_array; my $report_name = $_[0]; my $param = $_[1]; my $dir = "../data/ifx/reports/".$param."/".$report_name."/"; opendir (DIR, $dir) or die "cannot opendir $dir"; foreach my $file (readdir(DIR)) { if(($file eq ".") || ($file eq "..")) {} else { print "--------->"; print $file."
"; push(@report_array,$file); } } foreach my $unsorted_file(@report_array) { print $unsorted_file; } @report_array = sort {$a cmp $b} @report_array; foreach my $sorted_file(@report_array) { print $sorted_file."
"; } closedir (DIR); }