Since you have imported the standard CGI routines into the main namespace, you do not need to instantiate a CGI object and thus can use the function oriented method. I have rewritten this with that in mind. Also, all attributes for functions now have a dash "-" in front of them. I think the code below is much closer to what you are looking for.

#!/usr/local/bin/perl -w use strict; use CGI qw/:standard/; # load standard CGI routines print header( -type => 'text/html' ), start_html( -title => 'PMI Human Resources', -author => 'berry-kelly@pmimail.com', -meta => { 'keywords' => 'PMI HR HumanResources' +, 'copyright' => 'copyright 2001 Kelly Be +rry' }, -style => { 'src' => 'style.css' }, -BGCOLOR => 'blue'), start_form( -method => 'post', -action => 'editpositions.pl' ), p( "What is the Job Title?" ), textfield( 'JobTitle', '', 30, 80), br, br, "What is the Date Listed?", textfield( 'DateListed', '', 30, 80), br, br, "What is the Job Description?", br, textarea('Description', '', 10, 80), submit, end_form, end_html;

Look ma, no HTML!

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid - cleaning up your CGI code) Re: cgi.pm problem by Ovid
in thread HTML Tag attribute problems with CGI.pm by Prince99

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.