In my template file, i have written the code like below

[% IF cnt > 0 %] <tr><td colspan="2"> <h3 align="center">Have + you verified the Checklist ?</h3></td></tr> [%- SET i = 0; WHILE i < checklists.size; -%] <tr> <td> <input type="checkbox" name="chec +k_[% check_id.$i %]" value="1"/> </td> <td> [% checklists.$i %] </td> </tr> [%- SET i = i + 1; END -%]

And i want to take the name of the checklist in the cgi page, so that the value can be inserted into the database.since the name of the checklist has been given inside the array, i can't take that individually, so inthe cgi page, i have used the code like this :

if( $user->id){ my $usr = $user->id; my @userchecklist_id; my $check_ = "chck"; my $chck_ = "check"; my $quer = "SELECT checklist.id FROM group_management,User_group_manag +ement_mapping,profiles,checklist,checklist_group_mapping WHERE User_g +roup_management_mapping.userid = $usr and profiles.userid = User_gro +up_management_mapping.userid and group_management.id =User_group_mana +gement_mapping.groupid and checklist_group_mapping.checklist_id = che +cklist.id and checklist_group_mapping.group_id = group_management.id" +; my $query = $dbh -> prepare($quer); $query-> execute(); while(my($usrcheck_id) = $query->fetchrow_array()) { push (@userchecklist_id,$usrcheck_id); } foreach $usr( @userchecklist_id) { #print $usr . "\n"; #print $check_.$usr; my $check_.$usr = $cgi->param("$chck_.$usr"); print $chck_.$usr; } }
It is showing the error in the line my $check_.$usr = $cgi->param("$chck_.$usr");

only if i can take the name of the checkbox, i can insert the value into the database. How can i achieve this.??

Note : @userchecklist_id contains values same as that % check_id.$i %, used in the template file.


In reply to showing the error ,Can't modify concatenation (.) or string in scalar assignment by gayu_justin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.