"Jonathan Leffler" <[EMAIL PROTECTED]> wrote in message ...

> On 5/17/05, Konstantin Solodovnikov <[EMAIL PROTECTED]> wrote:
> > I'm having a problem with DBD::Informix when using it's functions via a
> > 'goto &$sub' mechanism.

> Que? What on earth is that?  Why do you want to use it?  Where did it ever
work?

It worked fine for me every time I used it in an AUTOLOAD routine.

> OK - the Camel book says 'goto LABEL' and 'goto EXPR' are rather like
> Fortran computed gotos and just as good for maintenance programmers.
> It says 'goto &NAME;' is OK for autoloaders who need to replace
> themselves with the function that they just loaded.  You aren't
> autoloading that I can see, so...why?

I *am* autoloading. But I stripped AUTOLOAD function from the example
to make it shorter and clearer, because the code shows the effect both
with or without the AUTOLOAD function.

> And Konstantin, what is the DBI->can() method for?  It is documented
> in DBI as returning true or false depending on whether a method is
> implemented by the driver or a default method is provided by DBI
> (perldoc DBI for v1.48).  So, what made you think that it returned a
> subroutine reference or name?  Your usage of it bears no relation to
> the documentation of it.

Well, DBI->can() returns a good sub reference for me, and it works fine, if
not interrupted by an SQL error.
But you are quite right about disadvantages of relying on undocumented
features of DBI API.
Could anyone point me at a more convenient way of implementing
an AUTOLOAD function?

BTW, if noone can rely on output of DBI->can() being a valid subroutine ref,
it surely breaks standards (see man UNIVERSAL).
And at least using it this way must be explicitly mentioned in the docs as a
bad practice.

Best regards,
Konstantin Solodovnikov,
JSC "Web Media Servises".
[EMAIL PROTECTED]


Reply via email to