I am using CGI.pm to create checkboxes for the attachment stripper.
When some checkboxes clicked and submitted, the script only sometimes functions as expected. However, there are times submission fails. i.e. "checked" boxes are not recognized.
Any insights, comments, or suggestions are appreciated.
use CGI;
.....
my $query = new CGI;
....
print $query->startform(-method => 'GET');
...
#obtaining the emails that were intended for the user.
#printing the To, Subject,etc.
#Calling sub print_checkbox for the emails that were stripped for the
+user.
...
print "<P>",$query->reset;
print "<P>",$query->submit;
print $query->endform;
# match_form called.
sub print_checkbox
{
#print" I am here $_[0]<br>";
print "<P>Do you want this e-mail message? ", $query->checkbox_gro
+up(-name =>'e_check',-values=>[$_[0]],-label=>[$_[0]]);
}
sub match_form
{
my $matcher="meep.tc.onramp.ca"; #for testing purposes
my @turned_on = ($query->param('e_check'));
print join(" ", @turned_on), "###\n";
my $email_checked;
print " I am in end_form before for each loop<br>";
foreach $email_checked (@turned_on){
if ($email_checked =~ /$matcher/)
{ #this part of the code should be executed
#for all the emails checked.. yet, executed only sometimes
#qmail-inject the mail
}
else
{
print "Nothing Equals, $email_checked<br>";
}
}
}
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.