... rude ... though I'm new ...

I gotta say the easiest way to get good advice is to swallow your pride. What's a little abuse in exchange for great tips? Nevermind

Why did you include %{} around your call to vars?

%form = %{$query->Vars}; # perl -MCGI=Vars -e" %a=Vars();print for keys %a " a=b c=d # perl -MCGI=Vars -e' %a=Vars();print for keys %a ' a=b c=d
I'd assume because you didn't know what the documentation clearly states (i know there is a ton of it, but we're only interested in the functions we use)
Many people want to fetch the entire parameter list as a hash in which the keys are the names of the CGI parameters, and the values are the parameters' values. The Vars() method does this. Called in a scalar context, it returns the parameter list as a tied hash reference. Changing a key changes the value of the parameter in the underlying CGI parameter list. Called in a list context, it returns the parameter list as an ordinary hash. This allows you to read the contents of the parameter list, but not to change it.
if ($webmaster eq "") {
I see a lot of people coming from javascript doing this type of stuff, but it's utterly unneccessary. if($webmaster) would suffice, if all you required is a true value. Consider this example instead of that chain of if/else statements
### Make sure things are being completed, die slackers! my %youMustProvide = ( message => "Only a severe slacker would try to submit a form without l +eaving a message!\n", usermail => "Ok, buddy, how do you expect me to email you back if you +FORGET to leave yoru email address?!?\n", username => "Please click back and type in your name so I can spy on y +ou!\n", ); for my $key(keys %youMustProvide ) { # unless the parameter is present, and has a true value unless(exists $form{$key} and $form{$key} ) { # notify the user of his *forgetfulness* print $youMustProvide{$key}; # and do whatever else you need to in such an instance } }
Some folks call it a "dispatch" table, and use it do do more than merely printing an error message, like providing regex patterns or callbacks for argument validation. There's probably even a module to do something like this (i know there is, but the name escapes me at the moment).

Anyways, I hope you got something from this.

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Insecurities in my scripting by PodMaster
in thread Insecurities in my scripting by sulfericacid

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.