in reply to Re: Re: goto and AUTOLOADed methods
in thread goto and AUTOLOADed methods

Couldn't you be better served by making those files into modules/objects and choosing which one(s) you want at the beginning, making it clearer to your maintainer(s) (which often is you) exactly what's going on?

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re3: goto and AUTOLOADed methods
by mpeppler (Vicar) on Aug 03, 2003 at 17:34 UTC
    I use the same technique - in my case it is for a database abstraction layer, where each file/subroutine describes a db access method, like this:
    package DBAccess; use strict; use Sybase::CTlib; sub addMaillog { my $self = shift; my %args = @_; my $config = { name => 'addMaillog', param => { token => { type => CS_CHAR_TYPE, opt => 0}, email => { type => CS_CHAR_TYPE, opt => 0}, action => { type => CS_CHAR_TYPE, opt => 0}, }, output => [ { name => 'maillog', cols => [qw(maillogId)], }], server => 'main', database => 'rpc', }; $self->execute($config, \%args); } 1;
    Each file only has this description, and everything else is handled by the rest of the package.

    It makes adding/modifying database requests very easy, though the fact that they are all stored procedure calls simplyfies things as well. There are no doubt other ways to do this, but it works fine for me at the moment.

    Note that this is based on Sybase::CTlib, but it could very well be built using DBI/DBD::Sybase as well.

    Michael