Anonymous Monk, using other people's objects is easier than writing them which takes a very different mind set from what I have now. What else should I use for my params if CGI is on its way out? I have not seen any suggested substitutes for CGI's param.
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena
| [reply] |
| [reply] |
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.
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena
| [reply] [d/l] [select] |
... the only time she actually uses CGI.pm is to gather query params ... Who mentioned CGI.pm?
I was talking about Common Gateway Interface, the non-persistent execution environment
| [reply] |
You meant something barely anyone uses anymore and no one should use for at least ten years already.
Using Common Gateway Interface, the non-persistent execution environment, should be considered a misconfiguration.
Jenda
Enoch was right!
Enjoy the last years of Rome.
| [reply] |
You did. You clearly never mentioned Plack, which is where everyone now is.
| [reply] |
You did. You clearly never mentioned Plack, which is where everyone now is. Great argument ... and is everyone there now for free? Plack is very much like Dancer/Moose under Common Gateway Interface, just extra overhead
| [reply] |