shahriyar85 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use utf8; use Switch; use CGI; $cgi = new CGI; print $cgi->header(-charset=>'UTF-8'), $cgi->start_html ( -title=>'Mahsoob Script' ), $cgi->h1('Mahsoob script'), $cgi->start_form ( -method=>'post', -action=>'' ), "Textbox: ", $cgi->textfield(-name=>'name',-size=>20), $cgi->br, "\n", "Textbox: ", $cgi->textfield(-name=>'mom',-size=>20), $cgi->br, "\n", "Textbox: ", $cgi->textarea(-name=>'tarekh',-coloumns=>20,-rows=>5), $cgi->br, "\n" +, $cgi->submit(-value=>'submit'), $cgi->br, "\n", $cgi->end_form; print "<br>"; $name = $cgi->param('name'); $mom = $cgi->param('mom'); $tarekh = $cgi->param('tarekh'); %freq = ( --arabic characters and their values ); %freq2 = ( --arabic characters and their values ); $namesum = 0; for (split //, $name) { $namesum += $freq{$_}; } $momsum=0; for (split //, $mom) { $momsum += $freq{$_}; } $sum=$namesum+$momsum; print "Sum: $sum\n"; $modulus =$sum%12; switch ( $modulus ) { --12 different cases , simple print statement } print $modulus; $cgi->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI won't pass to split
by Corion (Patriarch) on Jan 19, 2009 at 14:08 UTC | |
by shahriyar85 (Initiate) on Jan 19, 2009 at 14:20 UTC | |
by Corion (Patriarch) on Jan 19, 2009 at 14:21 UTC | |
by shahriyar85 (Initiate) on Jan 19, 2009 at 14:31 UTC | |
|
Re: CGI won't pass to split
by jeffa (Bishop) on Jan 19, 2009 at 14:38 UTC | |
by shahriyar85 (Initiate) on Jan 19, 2009 at 14:56 UTC | |
|
Re: CGI won't pass to split
by almut (Canon) on Jan 19, 2009 at 15:55 UTC | |
by shahriyar85 (Initiate) on Jan 19, 2009 at 19:16 UTC |