Rus Foster wrote:
> Hi All,
> I know what I'm about to ask is a really stupid question but I just
> can't get my head around my first outing with CGI.pm.

Don't worry. First dates are always a problem, but just remember that
CGI.pm is probably feeling just the same. Relax and enjoy yourselves.

> I've RTFM as
> appropiate but getting nowhere. All I want to do is dump a list of
> variable and their values which have been parsed to a script. So
> far I have
>
> #!/usr/bin/perl

  use strict;   # always
  use warnings; # usually

> use CGI qw(:all);
> $query = new CGI;
>
> @names = $query->param;
>
>
> print header(), start_html();
> foreach $entry (@names)
> {
> print em(param('$entry'))."<br> \n";
> }
>
> which I thought would work
>
> If I put print "$entry \n"; that prints out the variables but not
> the values. I know its going to be something stupid..What is it?

You're using a mixture of object and function-oriented. For your
purposes you should forget the $query object and just call the
functions. Like this

  use strict;
  use warnings;
  use CGI qw(:standard);

  my @names = param;

  print
    header,
    start_html;

  foreach my $entry (@names) {
    print em(param('$entry')), br, "\n";
  }

  print
    end_html;


HTH,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to