CGI.pm functions vs OO 
Author Message
 CGI.pm functions vs OO

What are the issues to consider when using CGI.pm concerning using just
functions or the OO interface?  Why choose one over the other?

Thanks,
Ben



Fri, 24 Sep 2004 13:02:24 GMT  
 CGI.pm functions vs OO


| What are the issues to consider when using CGI.pm concerning using just
| functions or the OO interface?  Why choose one over the other?

Using the OO interface might be cleaner.
a) you have all the methods at your disposal.
b) you don't import subs to your namespace.
c) if you import :standard or somesuch, you might be importing
-- unneeded subs
-- subs that you don't know about because you did not read the docs
thoroughly enough.

That's what I was able to think of off the top of my head. importing might
be a very slight degree faster.
My rule of tjhumb is to use the functional interface only if I'm just
importing very few subs like header, param, and url. The oo-interface should
be first choice for larger projects, IMHO.

Steffen
--
$_=qq#tsee      gmx.net#;s#e#s#g;s#[^\s\w]#c#;s#s#ust#g;s#t#J#e;s#nus#ker#





Fri, 24 Sep 2004 15:23:45 GMT  
 CGI.pm functions vs OO

Quote:


> | What are the issues to consider when using CGI.pm concerning using just
> | functions or the OO interface?  Why choose one over the other?

> Using the OO interface might be cleaner.
> a) you have all the methods at your disposal.
> b) you don't import subs to your namespace.
> c) if you import :standard or somesuch, you might be importing
> -- unneeded subs
> -- subs that you don't know about because you did not read the docs
> thoroughly enough.

> That's what I was able to think of off the top of my head. importing might
> be a very slight degree faster.
> My rule of tjhumb is to use the functional interface only if I'm just
> importing very few subs like header, param, and url. The oo-interface
should
> be first choice for larger projects, IMHO.

Thanks.  In the end I am using a combination with function interface o do
basic stuff and OO for things like forms etc.
Ben


Mon, 27 Sep 2004 20:20:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CGI.pm: procedural vs. OO

2. CGI.pm vs. Base.pm

3. CGI-modules vs. CGI.pm

4. CGI.pm :: OO or not?

5. cgi-lib.pl vs CGI.pm?

6. cgi-lib.pl vs CGI.pm

7. cgi.pm .vs. cgi-lib.pl

8. Libbent: File.pm and Error.pm: OO File-I/O with error checking

9. Libbent: File.pm and Error.pm: OO File-I/O with error checking

10. vvp:CGI.pm printing vs executing statments?

11. CGI.pm and POST vs GET methods

12. CGI.pm vs. mac characters

 

 
Powered by phpBB® Forum Software