On May 18, John Pretti said:

># Create New CGI Object
>my $q = new CGI;
>
># print form
>print   $q->header,
>        $q->start_html,
>        $q->br,
>        $q->start_multipart_form,
>        $q->p("Select a  promotion directory:"),

Here's your first problem:

>           %label = ('hw'=>'..support_docs/HW',
>           'nw'=>'..support_docs/NW',
>           'sw'=>'..support_docs/SW',
>           'swmfis'=>'..support_docs/SW/MFIS',
>           'swunifi'=>'..support_docs/SW/Unifi',
>           'swwebcaaf'=>'../support_docs/SW/WEBCAAF_eforms');

You're defining this hash in the middle of your print() calls.  That's
going to create the hash, but then print it out, and then your other
HTML-creating functions won't end up printing to anything, since you've
ended the print() statement with a semicolon.

>        $q->radio_group (
>                        -name=> 'promdir',
>                        -labels=>\%label,
>                        -default=>'selected',
>                        -linebreak=>'true'),
>        $q->br,
>        $q->submit('Promote'),
>        $q->end_form,
>        $q->end_html;

>[Tue May 18 13:46:01 2004] promote.cgi: Global symbol "%label" requires
>explicit package name at /www/web/cgi-sec/merlin/promote.cgi line 36.

But this is the more important problem.  You haven't declared %label as a
lexical variable, nor have you told Perl to let you use it as a global
variable.  You want to do:

  my $q = CGI->new;
  my %label = ( ... );  # put the creation of the hash here

and then

  print
        $q->header,
        $q->start_html,
        $q->br,
        $q->start_multipart_form,
        $q->p("Select a  promotion directory:"),
        $q->radio_group (
                        -name=> 'promdir',
                        -labels=>\%label,
                        -default=>'selected',
                        -linebreak=>'true'),
        $q->br,
        $q->submit('Promote'),
        $q->end_form,
        $q->end_html;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN    [Need a programmer?  If you like my work, let me know.]
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to