sub first_process { $data_dir="/data_dir/saurav/data"; open(F1,"<$data_dir/comment_job.config") || die "Cannot open file1:$!\n"; open(F2,"<$data_dir/comments_saurav.dat") || die "Cannot open file2:$!\n"; while(){ chomp; chomp(my $f2=); push (@comment, $_ . "|" . $f2 . "\n"); } } print $q->start_form( -name => 'main', -method => 'POST', -action => 'comment_saurav.cgi', ); # Part which is printing the table print $q->start_table; &first_process; foreach (@comment) { #array starts here ($jobname, $element, $comment)= split /\|/; my $element_drop=$element . "_drp"; print $q->Tr( $q->td($jobname), $q->td( $q->textfield(-name => $element, -size => 50, -default=> $comment) ), $q->td( $q->popup_menu(-name => $element_drop, -values => ['N/A','Infra Issue','UpStream Delay','Teradata Issue', 'AbInitio Issue','Others'], -default => 'N/A', -labels => \%cause_opt ) ) ); }#array ends here #---------------End of table-------------------------------- print $q->end_table; #### my $q = new CGI; my $params = $q->Vars; my %params = $q->Vars; my @hash_array_keys=keys %params; my @hash_array_values=values %params; open FILEHANDLE, ">/tmp/hash.dat" or die "Can not open hash.dat"; $, = "\n"; for my $k (sort @hash_array_keys) { print FILEHANDLE $k, $params{$k}; } #print FILEHANDLE values %params; close FILEHANDLE;