And this is how I am reading from the file.(Code snippet)# now write to the file open(OUT, ">/u001/data/slatrk/data/comments.dat"); foreach my $p (param()) { print OUT param($p) . "\n"; } print OUT "\n"; close(OUT);
Now I want to combine the two methods and I can write the data to the data using param. It should be in a loop so that i don't have to give textarea names separately. Can someone help me in this regard.# Extraction Process sub first_process { $data_dir="/u001/data/slatrk/data"; open(F1,"<$data_dir/comment_job.config") || die "Cannot open file1 +:$!\n"; open(F2,"<$data_dir/comments.dat") || die "Cannot open file2:$!\n" +; while(<F1>){ chomp; chomp(my $f2=<F2>); push (@comment, $_ . "|" . $f2 . "\n"); } } push(@rows,$q->th(['APPLICATION', 'COMMENT'])); &first_process; foreach (@comment) { #array starts here ($jobname, $comment)= split /\|/; push(@rows,$q->td([$jobname, '<textarea>'.$comment.'</textarea +>'])); }#array ends here print qq {<div id='container'>}; print $q->table( {-cellpadding => 3}, Tr(\@rows) );
In reply to read/write data in using CGI by sauravrout
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |