Chaim Frenkel wrote:
> 
> >>>>> "HB" == Hildo Biersma <[EMAIL PROTECTED]> writes:
> 
> HB> There's a reason people use objects - if only to give the user a handle
> HB> to wrap the module's state. Any module that supports both OO and
> HB> procedural usage is basically a singleton - only one instance exists at
> HB> any one time (at least in procedural mode).  For most modules, this
> HB> doesn't and shouldn't make sense.
> 
> Sorry, this doesn't make sense. Please explain the difference between
> 
>         $foo->twiddle and       twiddle $foo
> 
> Or to go to a more specific domain
> 
>         $fh = new File::Text "blah"     open($fh, "blah")
>         $txt = $fh->read                $txt = <$fh>
> 
> etc.
> 
> There is nothing preventing a procedural interface. One only needs a
> handle.

The original discussion was in the context of providing the same API for
object and method calls.  Of course I am aware that subroutines, using
handles, can do the same as objects - after all, that's the way objects
are implemented. of objects.

To get back at my earlier statement: if you want to provide the same API
for object calls and procedural calls, in the fashion of CGI, where the
procedural interface does not provide a handle, then you're basically
tied to a singleton.

Hildo

Reply via email to