You're using the CGI OO interface, so why use CGI qw/:standard/;?
//////* Open up your copy of CGI.pm, and take a look at :standard
':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/],
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();. *////////

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?

print "Content-type: text/html\n\n"; print "<HTML> \n"; print "<body bgcolor=000000 text=99CCCC> \n";
You got CGI, use it (print $q->header(),$q->start_html()....).

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.