Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(zdog) Re: Conceptualizing

by zdog (Priest)
on Dec 16, 2001 at 05:30 UTC ( #132287=note: print w/ replies, xml ) Need Help??


in reply to Conceptualizing

I'm not very good with OO terminology so I am not going to try to explain. However, under normal circustances, one will not do "use CGI qw(:standard);" and "my $q = new CGI;" at the same time. Both provide you with an interface for accessing CGI parameters, but go about it a little differently. With the example you have above, you could do this:

use CGI; my $q = new CGI; my $value = $q->param ('ord_id');
The param function assciated with the CGI object $q returns the value of the parameter passed to the script, so now $value contains whatever the order id was. The following does the same thing:
use CGI qw (:standard); my $value = param ('ord_id');
Except this time, param is no longer associated with an object and can be treated like any regular sub. Hope that helps at least a bit.

Zenon Zabinski | zdog | zdog@perlmonk.org


Comment on (zdog) Re: Conceptualizing
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://132287]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-07 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls