You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Matt Sergeant <ma...@sergeant.org> on 2000/07/31 18:11:09 UTC

Re: tie question

On Mon, 31 Jul 2000, dreamwvr wrote:

> hi,
>    why is tie considered not very efficient i use it often.. what is 'a'
> much better way?

tie isn't very efficient simply because the code behind it (in the core of
Perl) is fairly complex and slow. Theres not a lot that can be done to
improve it according to Ilya. I don't think there _is_ a better way - tie
is a very specific requirement, and usually its "fast enough". Remember
that STDOUT is tied to the request object in mod_perl...

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org


Re: tie question

Posted by Perrin Harkins <pe...@primenet.com>.
On Mon, 31 Jul 2000, Matt Sergeant wrote:

> On Mon, 31 Jul 2000, dreamwvr wrote:
> 
> > hi,
> >    why is tie considered not very efficient i use it often.. what is 'a'
> > much better way?
> 
> tie isn't very efficient simply because the code behind it (in the core of
> Perl) is fairly complex and slow. Theres not a lot that can be done to
> improve it according to Ilya. I don't think there _is_ a better way - tie
> is a very specific requirement, and usually its "fast enough". Remember
> that STDOUT is tied to the request object in mod_perl...

It's possible to call the object methods directly, and this will be faster
than using the tied interface.  Sometimes you can't do this because you
don't want to touch the code that uses the tied interface, but I've done
this successfully with Apache::Session and some other Tie:: modules
before.

Read the perltie manpage or open up the module you're using if you want to
see how to do it.

- Perrin