Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 lurking in the Monastery: (7)
As of 2014-12-23 03:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (135 votes), past polls