in reply to Re^7: How do I go from procedural to object oriented programming?
in thread How do I go from procedural to object oriented programming?
Anonymous Monk, I am aware CGI has been removed from the core. If my web host does upgrade, I will first go into shock then second go to work replacing CGI with whichever module is its clear successor. I looked over the alternatives and saw param/params listed in Dancer, but I'm not too clear on how to use Dancer's param.
CGI::Lite does not seem to have a param option, neither does Plack, which has been mentioned by others in this discussion.
I am at the ready to change use CGI; to whichever module is the easiest to use. Below are the lines where I use CGI's param. I am at the ready to do a find/replace in the 15 scripts where I use it, if someone would be kind enough to get me started in the right direction.
use CGI; use CGI::Carp qw(fatalsToBrowser); use HTML::Entities qw(encode_entities); my $cgi = CGI->new; # in Movies/Movie_by_alpha.pl my $year = $cgi->param('year') ? encode_entities($cgi->param('ye +ar'), '<>"') : ''; my $media = $cgi->param('media') ? encode_entities($cgi->param('me +dia'), '<>"') : ''; my $format = $cgi->param('format') ? encode_entities($cgi->param('fo +rmat'), '<>"') : ''; my $genre = $cgi->param('genre') ? encode_entities($cgi->param('ge +nre'), '<>"') : ''; my $basis = $cgi->param('based on') ? encode_entities($cgi->param('ba +sed on'), '<>"') : ''; my $title = $cgi->param('title') ? encode_entities($cgi->param('ti +tle'), '<>"') : ''; # in Movies/Movies_by_genre.pl my $select = encode_entities($cgi->param('genre'),'<>"'); # in Movies/Movies_by_series.pl my $select = encode_entities($cgi->param('series'),'<>"'); # in Role_playing/Magic_items/spell_scrolls.pl my $select = encode_entities($cgi->param('spell scroll'),'<>"'); # in Role_playing/Miscellany/Character_mutations_generator.pl my $iterations = $cgi->param('iterations') ? encode_entities($cgi->par +am('iterations'),'<>"') : 1; # in Role_playing/Miscellany/Word_finds.pl my $select = encode_entities($cgi->param('word find'),'<>"'); # in Role_playing/Monsters/index.pl my $select = $cgi->param('monster') ? encode_entities($cgi->param('mon +ster'),'<>"') : undef; # in Role_playing/Player_characters/Spellbooks.pl my $select = encode_entities($cgi->param('spellbook'),'<>"'); # in Role_playing/Reference_tables/Proficiencies.pl my $alpha = $cgi->param('alpha') ? encode_entities($cgi->param('alph +a'),'<>"') : ''; my @classes = $cgi->param('class') ? $cgi->param('class') : ''; # can' +t encode entities or array won't work. my $slots = $cgi->param('slots') ? encode_entities($cgi->param('slot +s'),'<>"') : ''; my $ability = $cgi->param('rel_ability') ? encode_entities($cgi->param +('rel_ability'),'<>"') : ''; # in Role_playing/Reference_tables/Weapons.pl my $broad = $cgi->param('broad') ? encode_entities($cgi->param('broad' +),'<>"') : ''; my $tight = $cgi->param('tight') ? encode_entities($cgi->param('tight' +),'<>"') : ''; # in working/Twitter/Follower_check.pl my $follower = encode_entities($cgi->param('follower'),'<>"'); my $outreach = encode_entities($cgi->param('outreach'),'<>"'); # in working/Twitter/Tweet_a_message.pl # can't encode entities on arrays since they won't work. my @account_select = $cgi->param('account_select'); my @list_select = $cgi->param('list_select'); my $tweet = encode_entities($cgi->param('tweet'),'<>"'); # in working/Twitter/Twitter_lists_properties.pl my $sort_by = encode_entities($cgi->param('sort'),'<>"'); # in working/Twitter/Twitter_mentions.pl my $select = encode_entities($cgi->param('accounts'),'<>"'); # in working/Twitter/Twitter_people.pl my $select = encode_entities($cgi->param('accounts'),'<>"');
Update 1: I am doing this now to hopefully get the discussion about procedural to object oriented programming back on track.
Update 2: I do not know if any of the current CGI alternative modules have a perl version restriction. The perl on my web host is 5.8.8. If any of them require a higher perl, you can skip it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: How do I go from procedural to object oriented programming?
by Anonymous Monk on Apr 23, 2015 at 18:30 UTC | |
by Lady_Aleena (Priest) on Apr 23, 2015 at 18:49 UTC | |
by Anonymous Monk on Apr 24, 2015 at 00:50 UTC |