That's a lot isn't it, and you're only using param (wasteful). You should either use CGI qw/param/; (not reccommended), or change your map hash builder to use $q->param(... instead of just param(... (also not reccommended). Or, and this is reccomended, just call Vars like i mention below (ala my %FORM = $q->Vars();. *////////':html2'=>['h1'..'h6',qw/p br hr ol ul li dl dt dd menu code v +ar strong em tt u i b blockquote pre img a address cite samp dfn htm +l head base body Link nextid title meta kbd start_html end_htm +l input Select option comment charset escapeHTML/], ':html3'=>[qw/div table caption th td TR Tr sup Sub strike app +let Param embed basefont style span layer ilayer font frameset fr +ame script small big/], ':form'=>[qw/textfield textarea filefield password_field hidde +n checkbox checkbox_group submit reset defaults radio_group popup_menu button auto +Escape scrolling_list image_button start_form end_form startfor +m endform start_multipart_form end_multipart_form isindex tmpFileN +ame uploadInfo URL_ENCODED MULTIPART/], ':cgi'=>[qw/param upload path_info path_translated url self_ur +l script_name cookie Dump raw_cookie request_method query_string Accept user_agent +remote_host content_type remote_addr referer server_name server_software server_po +rt server_protocol virtual_host remote_ident auth_type http save_parameters restore_parameters param_fetch remote_user user_name header redirect import_names put Delete Delete_all url_param cgi_error/], ':standard' => [qw/:html2 :html3 :form :cgi/],
You should also turn on taint ( #!perl -wT...)
* look for the cgi security stuff in perlfaq or search the site for taint checking (or visit Ovids homenode) for more info
What do you think $words = <TEXTFILE>; accomplishes? That will get a single line out the handle, is that what you want?
What's this?
You got CGI, use it (print $q->header(),$q->start_html()....).print "Content-type: text/html\n\n"; print "<HTML> \n"; print "<body bgcolor=000000 text=99CCCC> \n";
open (TEXTFILE,"$path_to_text") || die "where's the damn file? : $!" is pretty good, but || die "where's the hell is $path_to_text? : $!" is better.
It is also a good idea, to use CGI 2.73; #version, cause you never know.
Also, the way you build you %FORM is clever, but CGI (modern versions, not ancient), have a Vars method that will do that for you, and considerably (%50+) quicker (cause it doesn't call param a million times).
* - updates made
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
In reply to (crazyinsomniac) Re: Critique my First Script for me?
by crazyinsomniac
in thread Critique my First Script for me?
by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |