in reply to Re: (crazyinsomniac) Re: Critique my First Script for me?
in thread Critique my First Script for me?

the use CGI qw/:standard/; is left over from that, I thought it was invoking CGI.

use CGI; is all you need if you are using the OO interface (that's when you do my $q = CGI->new;). The 'qw/:standard/' part imports function names so that you don't need the $q variable and lets you, e.g., say 'param($field)' instead of '$q->param($field)', which makes it a little more of a hassle, but I don't like to import anything I don't have to, and sometimes you might need to create more than one CGI object, and so in that case the OO way is the only way to go.

Replies are listed 'Best First'.
Re: Re: Re: (crazyinsomniac) Re: Critique my First Script for me?
by blakem (Monsignor) on Sep 22, 2001 at 03:35 UTC
    sometimes you might need to create more than one CGI object

    I like and use the OO interface too, and I've heard the above statement before... Have you ever actually needed to create more than one CGI object? I don't believe I've *ever* seen anything like:

    my $q1 = CGI->new; my $q2 = CGI->new;
    Have you?

    -Blake

      Have you?

      I've seen it, and used it. Usually as a way to have one CGI object to set some parameters on (and retain the rest) so that I can print out various query strings for URL's (e.g., when you want page 1, page 2, etc., type links from a database query), and one CGI object to retain all of the original parameteters.