>>>>> "JG" == Jenn G <practicalp...@gmail.com> writes:

  JG> On Tue, Aug 11, 2009 at 2:33 PM, Uri Guttman<u...@stemsystems.com> wrote:
  >>>>>>> "JG" == Jenn G <practicalp...@gmail.com> writes:
  >> 
  >>  JG> When I create a package, and call its methods by both object way and
  >>  JG> function (exported) way, how to avoid the conflict in arguments
  >>  JG> passing?
  >> 
  >> why are you trying to do OO and procedural calls on the same subs? it
  >> makes no sense. how will a procedural find the 'object' the method style
  >> is going to use for its data? there is a technique for using procedural
  >> calls with a singleton object but that requires you assume only one
  >> object of that type ever. i don't think you seem to want that.
  >> 

  JG> Really? Hmm, see these below:

  JG> # perl -e 'use CGI qw/header/; print header()'
  JG> Content-Type: text/html; charset=ISO-8859-1

  JG> # perl -e 'use CGI; my $q=CGI->new; print $q->header'
  JG> Content-Type: text/html; charset=ISO-8859-1

that is doing the exact thing i mentioned, using a singleton object with
the procedural interface. this is NOT what you asked about. you seemed
to want a general way to do this which can't be done. very few OO libs
work with singletons as you generally want to create as many object as
you want.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to