in reply to Re^3: Problems around Param (CGI->param or CGI->multi_param instead of CGI->Vars )
in thread Problems around Param
Now while printing I don't need the names 'element' and 'element_drp', rather their values passed through the form.
I hope I am more clear with my question this time. some more code snippet:
Below is my current action page:sub first_process { $data_dir="/data_dir/saurav/data"; open(F1,"<$data_dir/comment_job.config") || die "Cannot open f +ile1:$!\n"; open(F2,"<$data_dir/comments_saurav.dat") || die "Cannot open +file2:$!\n"; while(<F1>){ chomp; chomp(my $f2=<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','Oth +ers'], -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;
|
|---|