On Thursday, Jun 26, 2003, at 23:45 US/Pacific, Octavian Rasnita wrote: [..]
You should create an object because you might import more modules in your
application that export the param() function/method.
In that case the program won't know which of those param() functions to use.
I guess this is just one reason, but I am sure there are more.
[..]

This is probably the best reason....

it's a simpler way to manage 'name space' issues.

This of course presumes that one does something like

        my $cgi    = new CGI;
        my $wombat = new Wombat;
        ....

my $cgi_param_foo = $cgi->param('input');

        if ( $wombat->param($cgi_param_foo) )
        {
                # right wombat
                $wombat->HappyHappyJoyJoy($cgi);

        } else {
                #
                # another waste of money brains and talent
                # that has to be fixed
                #
                $wombat->sullen_wombat_must_fix_earther($cgi);
        }
        #
        # cgi stuff now fixed up
        #
        ....

Basically, if you do not have total control over the
libraries you work with, it is important to work out
a strategy to avoid collisions...

Another strategy of course is to be explicit

my $input = CGI::param('input');

This way one knows that the param is the param() that
one means.... there is some trade off here, in that
one only imports the methods that one means to import...

ciao
drieux

---


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



Reply via email to