Tue Feb 24 14:11:10 2015] [error] [client 10.*.*.*] (2)No such file or directory: exec of '/var/www/cgi-bin/rdp_backuplogs_test' failed [Tue Feb 24 14:11:10 2015] [error] [client 10.*.*.*] Premature end of script headers: rdp_backuplogs_test #### #!usr/bin/perl use strict; use CGI; my $list = new CGI; my $fileDir = "/var/log/vista/stcr2tsvr/"; my @files; print $fileDir; opendir DIR, "$fileDir"; @files = grep(/\.log$/,readdir(DIR)); ## Example file to read 20150210-dubr3psvr-backup.log closedir DIR; print $list->header("text/html"), $list->start_html("Files in $fileDir"), $list->p("These are the files in $fileDir"); foreach my $file (@files) { print $list->p( $list->a({-href=>$file}, $file) ); } print $list->end_html;